Skip to content

Commit

Permalink
Minor adjustments / bug fixes
Browse files Browse the repository at this point in the history
- restrict extension to secure context (HHTPS),
  since "setSinkId()" requires this anyway
- avoid error when popup is opened for a Tab with a null URL
  • Loading branch information
necropola committed Dec 25, 2023
1 parent 8815cea commit eb8d258
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
"96": "AP_Icon96.png",
"128": "AP_Icon128.png"
},
"host_permissions": ["<all_urls>"],
"host_permissions": ["https://*/*"],
"background": {
"service_worker": "worker.js"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"matches": ["https://*/*"],
"js": ["content.js"],
"world": "ISOLATED",
"all_frames" : true
},
{
"matches": ["<all_urls>"],
"matches": ["https://*/*"],
"js": ["main.js"],
"world": "MAIN",
"all_frames" : true
Expand Down
2 changes: 1 addition & 1 deletion extension/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async function init() {
});
// If we're not on http or https immediately close.
// Extension doesn't like to work on chrome:// or file:// URLs.
if (activeTab.url.toLowerCase().indexOf("http") === -1) {
if (!activeTab.url || (activeTab.url.toLowerCase().indexOf("https") === -1)) {
window.close();
return;
}
Expand Down

0 comments on commit eb8d258

Please sign in to comment.