Bug 1921480 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The redirection occurs from empty.html to console.html (both are test pages from the Puppeteer test suite). Although the browser's URL bar displays "empty.html" and `location.href` is set to "empty.html", the page is actually constructed using the content from "console.html". This behaviour is present in Chrome.

As mentioned in [Bug 1898158 Patch](https://phabricator.services.mozilla.com/D223377), the initial request is for "/webdriver/tests/bidi/network/support/empty.html?1", then we redirect (`internalRedirectTo`) to "/webdriver/tests/bidi/network/support/empty.html?2". The redirect from Bug 1905037 ends up loading "empty.html?2", yet we want `window.location.href` and URL bar to be "/webdriver/tests/bidi/network/support/empty.html?1" not "/webdriver/tests/bidi/network/support/empty.html?2".

As Kershaw mentioned, we can probably set a flag `REDIRECT_TRANSPARENT` instead of `REDIRECT_INTERNAL`, then in `nsHttpHandler::AsyncOnChannelRedirect`, verify if `REDIRECT_TRANSPARENT`  is set and call `OnRedirectVerifyCallback(NS_OK);`. This way, we can avoid notifying the observers.
The redirection occurs from empty.html to console.html (both are test pages from the Puppeteer test suite). Although the browser's URL bar displays "empty.html" and `location.href` is set to "empty.html", the page is actually constructed using the content from "console.html". This behaviour is present in Chrome.

As mentioned in [Bug 1898158 Patch](https://phabricator.services.mozilla.com/D223377), the initial request is for "/webdriver/tests/bidi/network/support/empty.html?1", then we redirect ([`internalRedirectTo`](https://searchfox.org/mozilla-central/rev/9fa446ad77af13847a7da250135fc58b1a1bd5b9/netwerk/protocol/http/nsIHttpChannelInternal.idl#547)) to "/webdriver/tests/bidi/network/support/empty.html?2". The redirect from Bug 1905037 ends up loading "empty.html?2", yet we want `window.location.href` and URL bar to be "/webdriver/tests/bidi/network/support/empty.html?1" not "/webdriver/tests/bidi/network/support/empty.html?2".

As Kershaw mentioned, we can probably set a flag `REDIRECT_TRANSPARENT` instead of `REDIRECT_INTERNAL`, then in [`nsHttpHandler::AsyncOnChannelRedirect`](https://searchfox.org/mozilla-central/rev/9fa446ad77af13847a7da250135fc58b1a1bd5b9/netwerk/protocol/http/nsHttpHandler.cpp#762), verify if `REDIRECT_TRANSPARENT`  is set and call `OnRedirectVerifyCallback(NS_OK);`. This way, we can avoid notifying the observers.
The redirection occurs from empty.html to console.html (both are test pages from the Puppeteer test suite). Although the browser's URL bar displays "empty.html" and `location.href` is set to "empty.html", the page is actually constructed using the content from "console.html". This behaviour is present in Chrome.

As mentioned in [Bug 1898158 Patch](https://phabricator.services.mozilla.com/D223377), the initial request is for "/webdriver/tests/bidi/network/support/empty.html?1", then we redirect ([`internalRedirectTo`](https://searchfox.org/mozilla-central/rev/9fa446ad77af13847a7da250135fc58b1a1bd5b9/netwerk/protocol/http/nsIHttpChannelInternal.idl#547)) to "/webdriver/tests/bidi/network/support/empty.html?2". The redirect from Bug 1905037 ends up loading "empty.html?2", yet we want `window.location.href` and URL bar to be "/webdriver/tests/bidi/network/support/empty.html?1" not "/webdriver/tests/bidi/network/support/empty.html?2".

As Kershaw mentioned, we can probably set a flag `REDIRECT_TRANSPARENT` instead of `REDIRECT_INTERNAL`, then in [`nsHttpHandler::AsyncOnChannelRedirect`](https://searchfox.org/mozilla-central/rev/9fa446ad77af13847a7da250135fc58b1a1bd5b9/netwerk/protocol/http/nsHttpHandler.cpp#762), verify if `REDIRECT_TRANSPARENT`  is set and call `OnRedirectVerifyCallback(NS_OK);`. This way, we can avoid notifying the observers.

We should remove the API to `transparentRedirectTo`.
The redirection occurs from empty.html to console.html (both are test pages from the Puppeteer test suite). Although the browser's URL bar displays "empty.html" and `location.href` is set to "empty.html", the page is actually constructed using the content from "console.html". This behaviour is present in Chrome.

As mentioned in [Bug 1898158 Patch](https://phabricator.services.mozilla.com/D223377), the initial request is for "/webdriver/tests/bidi/network/support/empty.html?1", then we redirect ([`internalRedirectTo`](https://searchfox.org/mozilla-central/rev/9fa446ad77af13847a7da250135fc58b1a1bd5b9/netwerk/protocol/http/nsIHttpChannelInternal.idl#547)) to "/webdriver/tests/bidi/network/support/empty.html?2". The redirect from Bug 1905037 ends up loading "empty.html?2", yet we want `window.location.href` and URL bar to be "/webdriver/tests/bidi/network/support/empty.html?1" not "/webdriver/tests/bidi/network/support/empty.html?2".

As Kershaw mentioned, we can probably set a flag `REDIRECT_TRANSPARENT` instead of `REDIRECT_INTERNAL`, then in [`nsHttpHandler::AsyncOnChannelRedirect`](https://searchfox.org/mozilla-central/rev/9fa446ad77af13847a7da250135fc58b1a1bd5b9/netwerk/protocol/http/nsHttpHandler.cpp#762), verify if `REDIRECT_TRANSPARENT`  is set and call `OnRedirectVerifyCallback(NS_OK);`. This way, we can avoid notifying the observers.

We should rename the API to `transparentRedirectTo`.

Back to Bug 1921480 Comment 0