tl;dr: protocol handlers no longer set the LOAD_REPLACE flag, instead set loadInfo.resultPrincipalURI to channel.URI to change the address bar displayed URL.

More details in bug 1319111 [1].


In a bit more details - state BEFORE:

- The URL used for the result principal of the document (and shown in the address bar) was channel.originalURI, unless LOAD_REPLACE was set. Then it was channel.URI. Protocol handlers that wanted to affect this URL needed to set channel.URI appropriately and set the LOAD_REPLACE flag.

- If a protocol handler was delegating to another ("inner") protocol handler and wanted to revert the URI override, it removed the LOAD_REPLACE flag from the resulting channel.


State AFTER:

- To have a URL other than channel.originalURI show in the address bar and get used for the channel principal, a protocol handler sets loadInfo.resultPrincipalURI to that URL.

- If a protocol handler is delegating to another ("inner") protocol handler and wants to revert the URI override, it must save loadInfo.resultPrincipalURI before and then restore it after the "inner" protocol handler created the result channel.

- During HTTP redirects, if the target protocol handler does not set loadInfo.resultPrincipalURI to a non-null value while creating the channel, it will be set to the redirect target URI.

What has NOT CHANGED:

- LOAD_REPLACE is still set on channels that have been redirected by a 30X HTTP response from a server or have been internally redirected (subject to change in a followup bug) or are part of a multi-part content.

- originalURI of an HTTP-redirected channel is changed to the first URL in the whole redirect chain AFTER all redirect veto checks finished.

- channel.originalURI is used for the address bar and security checks by default when loadInfo.resultPrincipalURI is is left null (similarly to as when LOAD_REPLACE flag was not set).



-hb-


[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1319111


PS: Many thanks to Boris Zbarsky for his great help with this effort :)


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to