When i use tabs[0].url i get "about:blank" instead of real url in my addon
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(Not tracked)
People
(Reporter: oussama.elfidha, Unassigned)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
1- Create an addon
2-in background.js add this code :
browser.tabs.query({}, function (tabs) {
console.log("tabs[0]:" + tabs[0].url);
if (tabs.length == 1) {
browser.tabs.update({url: 'https://url'});
}
});
this is on Firefox developer edition 69 and sometimes on Firefox nightly 70.0a1
Actual results:
whaen i debug the result is about:blank in despite the first tab is not aa blank page
Expected results:
i should have the url of the first tab
Comment 1•7 years ago
|
||
Hi Oussemaf,
I'm a beginner at creating addons, could you please send me the files you used or an example so that I may try to reproduce this bug?
Thanks in advance, Flor.
Updated•7 years ago
|
Comment 2•7 years ago
|
||
Hello,
I have managed to successfully retrieve the URL of the first tab using the attached extension (also find attached the manifest and the background.js files of the extension) on the latest Nightly (70.0a1 / 20190813095543), Beta (69.0b12 / 20190807220259), Release (68.0.1 / 20190717172542) and Developer Edition (69.0b13 / 20190812173625) under Windows 10 Pro 64-bit and macOS High Sierra 10.13.6.
I believe the behavior you have reported was caused by the lack of the tabs permission in the manifest file, as you can see at: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab.
Please consider the attached files and let me know whether they work for you and leave me feedback in a comment so I can change the status of the issue accordingly. Thanks !
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Updated•7 years ago
|
Hi,
Thank you for your quick reaction. When i used before the console print "about:blank" however the first page is'nt blank but now i can't repoduce the problem.
I think that the problem is resolved under Firefox Nightly Version 70.0a1 (2019-08-27) (32-bit).
Anyway thanks all for our assistance :)
Updated•7 years ago
|
Description
•