Add pendingUrl to tabs.Tab
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: kernp25, Unassigned)
References
Details
(Keywords: parity-chrome)
Chrome now has a "pendingUrl" property in tabs.Tab:
https://developer.chrome.com/extensions/tabs#property-Tab-pendingUrl
The URL the tab is navigating to, before it has committed. This property is only present if >the extension's manifest includes the "tabs" permission and there is a pending navigation.
Should Firefox also have this property?
Comment 2•6 years ago
|
||
Assuming it's possible, yeah we should add it. I don't know that we'd get to it soon. I'll leave off priority so we triage it next week.
Updated•6 years ago
|
Comment 3•6 years ago
|
||
Additional documentation about the change in Chrome:
- "Announcement: Upcoming change to make the url property on Tabs more reliable" - https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/5zu_PT0arls/qgEk70D0CwAJ
- Change: https://chromium.googlesource.com/chromium/src/+/92389f75d0c3e82e8c938a5eb19a8910db524760%5E%21/
The url property used to refer to what was shown in the location bar; now it reflects the actual URL of the loaded document.
pendingUrl is only set if there is a pending navigation, and it holds the value of the URL that is being loaded but not committed yet. This is possible, because in Chrome all loads goes through the main browser process.
In Firefox, we internally use browser.currentURI, i.e. browser.webNavigation.currentURI. The latter is updated upon onLocationChange, which matches with when webNavigation.onCommitted is triggered. So, with Chrome's change, their .url property now matches with how Firefox has already been behaving.
In order to implement pendingUrl, we need to be able to query the URL/nsIURI of the tab's current pending load, from the parent process. Is this information even available?
Updated•3 years ago
|
Does it mean that on Firefox, there is no way to collect the URL of newly opened tabs? Assumes the user opened a new tab via middle click and the tab is not loaded yet.
Updated•2 years ago
|
Comment 5•1 year ago
|
||
(In reply to eight04 from comment #4)
Does it mean that on Firefox, there is no way to collect the URL of newly opened tabs? Assumes the user opened a new tab via middle click and the tab is not loaded yet.
The title property of a newly opened tab appears to contain the pending URL, albeit without the scheme portion (e.g. "example.com/path/"). There are exceptions, as far as I know: Blank and Firefox Home tabs, whose title properties say "New Tab" instead.
Description
•