Protocol handler defined via manifest.json breaks pages with iframes that use it
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: lidel, Assigned: Gijs)
References
Details
Attachments
(1 file)
|
84.97 KB,
application/zip
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0
Steps to reproduce:
Tried to open a page with iframe loaded via protocol handler defined in WebExtension's manifest.json:
<iframe src="web+iframeb://demo"
I attach simple extension with a minimal repro.
This could be related to similar bug reported for non-Webextension registerProtocolHandler: https://bugzilla.mozilla.org/show_bug.cgi?id=1196151
Actual results:
Page loads, then iframe loads, then parent page gets replaced with the URL that should be loaded in iframe (iframe escape)
Expected results:
web+iframeb://demo should load in iframe and stay there
Comment 1•6 years ago
|
||
To clarify, this is an iframe that is in an extension content page (web_accessible_resources), with a src value that is a custom protocol URL?
Does the breakage happen in iframes in regular web pages?
The documentation for protocol handler is not clear on which contexts are supported, only mentions "clicks" while illustrating an example.
| Reporter | ||
Comment 2•6 years ago
|
||
Yes, the breakage happen in iframes on regular web pages loaded via https:// as well.
(I shipped test page with extension only to make it easier to run).
Updated•6 years ago
|
Comment 3•6 years ago
|
||
On a webpage, if you use navigator.registerProtocolHandler, can you use the protocol in the src of the iframe? In other words, does this reproduce using the web rather than using an extension? I ask because the protocol_handlers implementation simply uses the same underlying framework that navigator.registerProtocolHandler uses.
Comment 4•6 years ago
|
||
Ooops. I'm not certain that bug 1560178 is involved after some testing.
Updated•6 years ago
|
| Reporter | ||
Comment 5•6 years ago
|
||
Yes, I can confirm, this reproduce using the navigator.registerProtocolHandler (regular web) too.
Repro:
- Open https://ipfs.io/ipfs/bafybeigimkiixjlqjrxh5ewyjddcyrh3hfa2rakk5bnvapsy5hiisepidm/ and accept protocol handler registration for "web+ifrme://"
- Open https://ipfs.io/ipfs/bafybeigimkiixjlqjrxh5ewyjddcyrh3hfa2rakk5bnvapsy5hiisepidm/demo.html and select the handler whenm prompted how to load the iframe URL
- In Firefox 71 iframe content (text file with "hello") will load in the parent frame, instead of iframe
| Assignee | ||
Comment 6•6 years ago
|
||
This is using some ancient combination of https://searchfox.org/mozilla-central/source/uriloader/exthandler/WebHandlerApp.jsm and implementation in https://searchfox.org/mozilla-central/source/dom/ipc/ContentParent.cpp#1362 to load the resulting URI in the right frame.
It should probably just be switched to browsing contexts and this weird nsIRemoteWindow thing should be removed, I guess?
Comment 7•6 years ago
|
||
It should probably just be switched to browsing contexts and this weird nsIRemoteWindow thing should be removed, I guess?
Fission Milestone: --- → ?
Gijs, this is not a Fission bug. Are you asking whether this bug might go away if this code is ported to BrowsingContext?
| Assignee | ||
Comment 8•6 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #7)
It should probably just be switched to browsing contexts and this weird nsIRemoteWindow thing should be removed, I guess?
Fission Milestone: --- → ?Gijs, this is not a Fission bug. Are you asking whether this bug might go away if this code is ported to BrowsingContext?
No, I'm not asking - I'm pretty sure it'll go away. This bug just seemed to tie in with the fission effort, but it's just as broken without fission so I guess we can avoid tracking it...
Comment 9•6 years ago
|
||
(In reply to :Gijs (he/him) from comment #8)
No, I'm not asking - I'm pretty sure it'll go away. This bug just seemed to tie in with the fission effort, but it's just as broken without fission so I guess we can avoid tracking it...
In that case, I'll tag this bug as "Fission Milestone == Future", meaning this bug will require some work integrating with Fission code but doesn't block shipping Fission MVP.
| Assignee | ||
Comment 10•6 years ago
|
||
I fixed bug 1196151, and the testcase from comment #0 works for me now.
Marcin, can you confirm this works on Nightly? ( https://nightly.mozilla.org/ )
| Reporter | ||
Comment 11•6 years ago
|
||
I tested with 78.0a1 (2020-05-27) (64-bit) and can confirm the issue is fixed, thank you!
| Assignee | ||
Comment 12•6 years ago
|
||
Thanks for checking!
Updated•5 years ago
|
Description
•