Open Bug 1859545 Opened 1 year ago Updated 1 year ago

browsingContext.navigationStarted has the wrong URL for a http-equiv refresh "redirect"

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect
Points:
3

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

(Whiteboard: [webdriver:backlog])

From Bug 1859299 comment 1:

While writing a test here for redirects, I noticed something unexpected when using the meta http-equiv=refresh in order to redirect to another page. Basically I have pageA.html which contains this meta with content="0;pageB.html". There's a first channel created to load pageA.html, and then a second one to load pageB.html. But this second channel still has pageA.html as originalURI. While I would expect this for a real redirect, I thought that for a refresh it would be set to pageB.html.

It's not entirely clear if this is intentional or not, but since we use nsIChannel.originalURI to know what is the url for the browsingContext.navigationStarted, this leads to having the wrong url for second navigationStarted event emitted during a navigation to a page using http-equiv=refresh.

We can use nsIChannel.URI instead. In case of http header redirects this will change as the redirection happens, but for navigationStarted it should be safe to use as long as keep ignoring the duplicate navigation-started (internal) events we get during the redirection.

A failing wdspec test should be added for this in Bug 1859299 and should pass once this is fixed.

Points: --- → 3
Priority: -- → P3
Whiteboard: [webdriver:backlog]

Henrik: you mentioned this could be related to a Puppeteer test failure about a redirect. Let me know if you find which issue this was?

Flags: needinfo?(hskupin)

Oh I thought it might have been bug 1853988 but it's not.

Flags: needinfo?(hskupin)

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)
Severity: -- → S3
Flags: needinfo?(hskupin)
You need to log in before you can comment on or make changes to this bug.