Skip to content

Commit 4c4b9bb

Browse files
committed
Change to activeTab permission
Signed-off-by: Alan D. Tse <alandtse@gmail.com>
1 parent 4a95520 commit 4c4b9bb

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

app/manifest.json

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,7 @@
2323
"page": "pages/options.html",
2424
"open_in_tab": false
2525
},
26-
"content_scripts": [
27-
{
28-
"matches": [
29-
"<all_urls>"
30-
],
31-
"css": [
32-
"styles/contentscript.css"
33-
],
34-
"js": [
35-
"scripts/contentscript.js"
36-
],
37-
"run_at": "document_end",
38-
"all_frames": false
39-
}
40-
],
4126
"web_accessible_resources": [ "license-list/*"],
42-
"permissions": ["storage", "unlimitedStorage"],
27+
"permissions": ["storage", "unlimitedStorage", "activeTab"],
4328
"content_security_policy": "script-src 'self' https://spdx.org; object-src 'self'"
4429
}

app/scripts/background.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ chrome.browserAction.setBadgeText({
2929

3030
chrome.browserAction.onClicked.addListener(function(tab) {
3131
// Send a message to the active tab
32+
chrome.tabs.executeScript({file: "scripts/contentscript.js"});
33+
chrome.tabs.insertCSS({file:"styles/contentscript.css"});
34+
3235
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
3336
var activeTab = tabs[0];
3437
chrome.tabs.sendMessage(activeTab.id, {"command": "clicked_browser_action"});

0 commit comments

Comments
 (0)