Here's my manifest.json:
On my background.js, I have this:
When I open a new tab I see this in the background log:
Problem 1
Why are the title, url and pendingUrl empty if I have the permission set for all urls and the user accepted it?
Problem 2
Safari internal pages url, eg.: "about:blank" are not included in browser.tabs.query, eg.:
browser.tabs.query({}, el => { console.log(el)})
Code Block json { "manifest_version": 2, "default_locale": "en", "name": "MSG_extension_name", "description": "MSG_extension_description", "version": "1.0", "icons": { "48": "images/icon-48.png", "96": "images/icon-96.png", "128": "images/icon-128.png", "256": "images/icon-256.png", "512": "images/icon-512.png" }, "background": { "scripts": [ "background.js" ] }, "content_scripts": [{ "js": [ "content.js" ], "matches": [ "*://example.com/*" ] }], "browser_action": { "default_popup": "popup.html", "default_icon": { "16": "images/toolbar-icon-16.png", "19": "images/toolbar-icon-19.png", "32": "images/toolbar-icon-32.png", "38": "images/toolbar-icon-38.png" } }, "permissions": ["<all_urls>", "tabs"] }
On my background.js, I have this:
Code Block javascript browser.tabs.onCreated.addListener(tab => { console.log("onCreated", tab) }) browser.tabs.onCreated.addListener((tabId, changeInfo, tab) => { console.log("onUpdated", tabId, changeInfo, tab) })
When I open a new tab I see this in the background log:
Code Block language "onCreated": { "id": 7, "index": 1, "active": true, "width": 938, "audible": false, "url": "", "mutedInfo": { "muted": false }, "windowId": 2, "title": "", "pendingUrl": "", "incognito": true, "pinned": false, "height": 1027, "highlighted": true, "status": "complete" }
Code Block language "onUpdated": { "id": 7, "index": 1, "active": true, "width": 938, "audible": false, "url": "", "mutedInfo": { "muted": false }, "windowId": 2, "title": "", "pendingUrl": "", "incognito": true, "pinned": false, "height": 1027, "highlighted": true, "status": "complete" }
Problem 1
Why are the title, url and pendingUrl empty if I have the permission set for all urls and the user accepted it?
Problem 2
Safari internal pages url, eg.: "about:blank" are not included in browser.tabs.query, eg.:
browser.tabs.query({}, el => { console.log(el)})