Closed Bug 1567911 Opened 7 years ago Closed 7 years ago

When i use tabs[0].url i get "about:blank" instead of real url in my addon

Categories

(WebExtensions :: Untriaged, defect)

69 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: oussama.elfidha, Unassigned)

Details

Attachments

(4 files)

Attached image aboutblank.png —

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

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.

Flags: needinfo?(oussama.elfidha)
Product: Firefox → WebExtensions
Version: 69 Branch → Firefox 69

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 !

Attached file URL_Test_Addon.xpi —
Attached file background.js —
Attached file manifest.json —
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID

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 :)

Flags: needinfo?(oussama.elfidha)
Version: Firefox 69 → 69 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: