Skip to content

Commit fdd6ac5

Browse files
committed
Extension version v3
1 parent 5aa2e8a commit fdd6ac5

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

chrome/background.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
chrome.browserAction.onClicked.addListener(function(tab) {
2-
chrome.tabs.insertCSS(tab.id, { file: "combined.css" });
3-
chrome.tabs.executeScript(tab.id, { file: "combined.js" });
1+
chrome.action.onClicked.addListener(function (tab) {
2+
chrome.scripting.executeScript({
3+
target: {tabId: tab.id},
4+
files: ['combined.js']
5+
});
6+
7+
chrome.scripting.insertCSS({
8+
target: {tabId: tab.id},
9+
files: ['combined.css']
10+
});
411
});

chrome/footer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var interval = setInterval(function() {
66
if (typeof SelectorGadget != 'undefined') {
77
clearInterval(interval);
8-
SelectorGadget.toggle();
8+
SelectorGadget.toggle({ analytics: false });
99
}
1010
}, 50);
11-
})();
11+
})();

chrome/manifest.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
{
2-
"manifest_version": 2,
2+
"manifest_version": 3,
33
"icons": { "16": "icons/16x16.png",
44
"48": "icons/48x48.png",
55
"128": "icons/128x128.png" },
66
"name": "SelectorGadget",
77
"homepage_url": "http://selectorgadget.com",
88
"description": "Easy, powerful CSS Selector generation.",
9-
"version": "1.1.1",
10-
"permissions": [
11-
"http://*/*", "https://*/*"
9+
"version": "1.2.0",
10+
"permissions": ["scripting"],
11+
"host_permissions": [
12+
"http://*/*",
13+
"https://*/*"
1214
],
1315
"background": {
14-
"scripts": ["background.js"],
15-
"persistent": false
16+
"service_worker": "background.js",
17+
"type": "module"
1618
},
17-
"browser_action": {
19+
"action": {
1820
"default_icon": {
1921
"19": "icons/action19x19.png",
2022
"38": "icons/action38x38.png"

0 commit comments

Comments
 (0)