Closed Bug 1339095 Opened 9 years ago Closed 9 years ago

webRequest the property "originUrl" has always the same value as long as there is no page refresh

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: 21Naown, Unassigned)

Details

(Whiteboard: triaged)

chrome.webRequest.onResponseStarted.addListener(function, {urls: [xxxx]}, ["responseHeaders"]); for example with a playlist on YouTube, "originUrl" has always the same value as long as there is no page refresh.
originUrl is not necessarily the document that is being viewed. It is the "triggeringPrincipal" that triggers the load of the page being viewed. Bug 1311815 is adding documentUrl which is the document that the request is being loaded *into*, which is probably what you're looking for. As well, some sites like youtube have a tendency to refresh the content rather than replace/reload the entire document. While everything appears to be a reload, at a lower level it may not be.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
Whiteboard: triaged
"documentUrl" is available with Firefox 54 (or maybe before), but it gives me the same value as "originUrl", again tested with a playlist on YouTube. There is no documentation about "documentUrl" for any webpage, here for example: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/onBeforeRequest. I do not think it is intended.
Flags: needinfo?(mixedpuppy)
The second part of my comment 1 is likely what is happening. Try on a site that does actually refresh the document.
Flags: needinfo?(mixedpuppy)
If "originUrl" and "documentUrl" do not retrieve the previous URL or the URL which called the new content, so no it is not what I am looking for. If you understand what I said (maybe I am not accurate enough), do you think it is possible to make this and if it can be useful to others? Otherwise I have another solution/"workaround" but another variable which contains what I said is a better choice.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.