Skip to content

Commit d99116b

Browse files
committedFeb 6, 2025
migrate to Manifest V3 and update scripting methods
1 parent a227619 commit d99116b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed
 

‎app/javascripts/browser/tabs.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ var tabs = {
2020
},
2121

2222
executeScript: function(tabId, script) {
23-
chrome.tabs.executeScript(tabId, { code: script });
23+
chrome.scripting.executeScript({
24+
target: { tabId: tabId },
25+
func: new Function(script)
26+
});
2427
}
2528

2629
};

‎app/javascripts/tabWatcher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
require('./browser/listeners.js');
1+
importScripts('./browser/listeners.js');

‎app/manifest.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"manifest_version": 2,
2+
"manifest_version": 3,
33
"default_locale": "en",
44
"update_url":"http://clients2.google.com/service/update2/crx",
55
"name": "Zendesk Quicktab",
66
"description": "Well behaved browser tabs for Zendesk agents",
77
"version": "0.12.0",
88
"background": {
9-
"scripts": ["javascripts/tabWatcher.js"],
10-
"persistent": true
9+
"service_worker": "javascripts/tabWatcher.js"
1110
},
12-
"page_action": {
11+
"action": {
1312
"default_icon": {
1413
"19": "images/icons/icon38-enabled.png",
1514
"38": "images/icons/icon38-enabled.png"
1615
},
1716
"default_title": "Zendesk QuickTab",
1817
"default_popup": "popup.html"
19-
},
18+
},
2019
"permissions": [
2120
"http://*.zendesk.com/*",
2221
"https://*.zendesk.com/*",
2322
"webNavigation",
24-
"tabs"
23+
"tabs",
24+
"scripting"
2525
],
2626
"icons": {
2727
"16": "images/icons/icon-16.png",

0 commit comments

Comments
 (0)
Please sign in to comment.