tab object missing url property

332 views
Skip to first unread message

nem...@readcube.com

unread,
May 6, 2022, 6:58:09 AM5/6/22
to Chromium Extensions
 Hi!

I have an extension that started to behave strange few chrome versions ago.

Sometimes, and I cannot detect exactly when, our extensions stops working, and the reason is that tab object is missing url property. 

By using chrome.tabs.query I'm getting active tab, and tab is always returned correctly, and almost always has url property. But sometimes it just stops working and url property is missing.

Uninstalling extension (or any other extension you have installed) solves the problem. Because problem is fixed by uninstalling any other extension user may have installed I thought it might be some chrome error.

Anyone had similar issue or have any idea what could be causing this?

Thanks

hrg...@gmail.com

unread,
May 6, 2022, 8:53:21 AM5/6/22
to Chromium Extensions, nem...@readcube.com
The "url" property is missing when a tab is newly created and it's still communicating with the server to start downloading the page.
In this situation, the URL that's being loaded is in the "pendingUrl" property and not the "url" property because there's no page in the tab yet.

nem...@readcube.com

unread,
May 6, 2022, 9:26:51 AM5/6/22
to Chromium Extensions, hrg...@gmail.com, nem...@readcube.com
Hi,

thanks for answering. 

what you says sounds fine, but in my case, when this "bug" triggers, pendingUrl is missing also. So it is not just one time problem on one load, whenever that happens, extension cannot access url property of tab object in any case in any time anymore. only extension reinstall solves the problem, and then everything works as expected until next "bug" trigger. and the strangest thing is reinstall of any installed extension helps

EML

unread,
Aug 29, 2023, 9:03:42 AM8/29/23
to Chromium Extensions, nem...@readcube.com
Looks like a bug to me; I'm on Linux 116. See also this thread on SO. Do you have a debugger window open? In my case, "chrome.tabs.query({ active: true, currentWindow: true })" generally returns the url, but very occasionally it's missing. I don't need to uninstall the extension; it seems that trying a few times will fix it. 

It's not a race condition on tab creation; this is long after the tab was created. I do have a debugger window, but it's generally minimised, and this can happen whether or not the devtools window is visible or focused. When there's no url, calling "chrome.tabs.query({ active: true, lastFocusedWindow: true })" returns an empty array.

Reply all
Reply to author
Forward
0 new messages