Closed
Bug 1253307
Opened 9 years ago
Closed 9 years ago
[e10s] Opening in a new tab/window a link handled by a web protocol handler shows the wrong URL
Categories
(Core :: DOM: Content Processes, defect)
Core
DOM: Content Processes
Tracking
()
RESOLVED
FIXED
mozilla48
People
(Reporter: florian, Assigned: mrbkap)
References
()
Details
(Whiteboard: btpp-followup-2016-03-10)
Attachments
(2 files, 2 obsolete files)
|
2.97 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
|
8.12 KB,
patch
|
mconley
:
review+
ritu
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
This is very similar to bug 1116478.
Steps to reproduce:
1. Load https://people.mozilla.org/~fqueze2/tmp/registerProtocolhandler.html
2. Click on the "click here to register a test protocol handler" line.
3. Click the "Add Application" button in the notification bar.
4. Go to about:preferences#applications
5. Find the "webcal" type in the list, and set the default application to "Test"
6. On the page loaded at step #1, open the "test webcal link" in a new tab (either using Cmd+click, or the "Open Link in New Tab" context menu item).
Expected result:
A new tab with this URL:
https://people.mozilla.org/~fqueze2/tmp/registerProtocolhandler.html?s=webcal%3Ahttp%3A%2F%2Fexample.org%2F
The favicon should be the favicon of https://people.mozilla.org/ (ie. a Firefox logo).
Actual result with e10s enabled (in a non-e10s window, the bug can't be reproduced):
A new tab with "webcal:http://example.org/" in the URL bar and no favicon.
Note: if opening the link in a new window instead of in a new tab, the URL bar shows "about:blank".
I think the reason why this wasn't noticed while fixing bug 1116478 is that the STRs there involve using Gmail, which immediately redirects; hiding the problem.
Updated•9 years ago
|
Whiteboard: btpp-followup-2016-03-10
Updated•9 years ago
|
Assignee: nobody → mrbkap
| Reporter | ||
Comment 1•9 years ago
|
||
I wrote a test for this in bug 1254118 (contains several |todo()| and |if (browser.isRemote)| that should be removed once this bug is fixed).
| Assignee | ||
Comment 2•9 years ago
|
||
I don't know why I invented OpenURI instead of using LoadURL in the first place. I think I was worried about not passing the |flags| argument properly through but testing shows that it isn't important (and code inspection also shows that it isn't needed in this case). Much easier.
Attachment #8729710 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 3•9 years ago
|
||
Florian's test hasn't landed yet but these are the changes to it for when it does.
Attachment #8729711 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8729710 [details] [diff] [review]
Patch v1
Review of attachment 8729710 [details] [diff] [review]:
-----------------------------------------------------------------
Generally this seems like a good thing. I had forgotten about LoadURL. I have two questions though.
First, why does this fix the problem?
Second, I'm concerned about the initialization-time stuff that RecvLoadURL does. Normally I think we only call this function when the frame loader is created. The process name code does some debug stuff that seems wrong at this time, and I don't know what the consequences of re-running that service worker registration stuff are. Maybe not a big deal, but it might be nice to have some static vars to make sure this stuff happens only once.
Attachment #8729710 -
Flags: review?(wmccloskey)
Attachment #8729711 -
Flags: review?(wmccloskey) → review+
| Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #5)
> First, why does this fix the problem?
When I wrote the patch in bug 1116478, I missed that I had to set LOAD_DOCUMENT_URI on the channel's loadFlags before calling into nsURILoader. In fact, if I add that, this bug is also fixed. Would you prefer that patch or the patch here with statics for the initialization stuff?
Flags: needinfo?(wmccloskey)
| Assignee | ||
Comment 7•9 years ago
|
||
The other major difference between the two approaches is that I can't find where we call content security checks for the nsURILoader version. I think I prefer adding statics to protect against re-initialization and keeping this patch's general direction.
(In reply to Blake Kaplan (:mrbkap) (please use needinfo!) from comment #7)
> The other major difference between the two approaches is that I can't find
> where we call content security checks for the nsURILoader version. I think I
> prefer adding statics to protect against re-initialization and keeping this
> patch's general direction.
Yeah, sounds good to me.
Flags: needinfo?(wmccloskey)
| Assignee | ||
Comment 9•9 years ago
|
||
I surrounded all of the init code in RecvLoadURL with a static protector.
Attachment #8730371 -
Flags: review?(mconley)
| Assignee | ||
Updated•9 years ago
|
Attachment #8729710 -
Attachment is obsolete: true
| Assignee | ||
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
Comment on attachment 8729710 [details] [diff] [review]
Patch v1
Review of attachment 8729710 [details] [diff] [review]:
-----------------------------------------------------------------
This seems fine. I haven't done the deep-dive that you have regarding not passing the flags, but I trust you.
My only complaint is that we're keeping the aFlags argument to the nsIRemoteWindowContext OpenURI call. Should probably just wipe that out if we're ignoring it.
::: dom/ipc/ContentParent.cpp
@@ +1598,5 @@
> return QueryInterface(aIID, aSink);
> }
>
> NS_IMETHODIMP
> RemoteWindowContext::OpenURI(nsIURI* aURI, uint32_t aFlags)
If we're just ignoring this flags argument, we should probably just remove it from the method signature.
Attachment #8729710 -
Attachment is obsolete: false
Attachment #8729710 -
Flags: review+
| Assignee | ||
Comment 12•9 years ago
|
||
(In reply to Mike Conley (:mconley) - Needinfo me! from comment #11)
> If we're just ignoring this flags argument, we should probably just remove
> it from the method signature.
This is implementing an IDL interface that's implemented elsewhere (and doesn't ignore the flags argument) so I can't just remove it, sadly.
| Assignee | ||
Comment 13•9 years ago
|
||
I was confused, here's a patch with mconley's suggestion.
Attachment #8730475 -
Flags: review?(mconley)
| Assignee | ||
Updated•9 years ago
|
Attachment #8729710 -
Attachment is obsolete: true
Attachment #8730371 -
Attachment is obsolete: true
Attachment #8730371 -
Flags: review?(mconley)
Comment 14•9 years ago
|
||
Comment on attachment 8730475 [details] [diff] [review]
Patch v1.6
LGTM, thanks!
Attachment #8730475 -
Flags: review?(mconley) → review+
Comment 16•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Comment 17•9 years ago
|
||
Blake, should this fix be uplifted to Aurora 47 in preparation for our e10s experiments on Beta 47?
status-firefox46:
--- → wontfix
Flags: needinfo?(mrbkap)
| Assignee | ||
Comment 18•9 years ago
|
||
Comment on attachment 8730475 [details] [diff] [review]
Patch v1.6
Approval Request Comment
[Feature/regressing bug #]: bug 1116478
[User impact if declined]: web protocol handlers opened in new tabs will have uninitialized UI elements.
[Describe test coverage new/current, TreeHerder]: There are tests on Treeherder (thanks Florian!).
[Risks and why]: Low risk.
[String/UUID change made/needed]: n/a
Flags: needinfo?(mrbkap)
Attachment #8730475 -
Flags: approval-mozilla-aurora?
Hi Blake, could this impact non-e10s behavior? I just want to make sure even though we will uplift this to 47 for e10s experiments, it should not pose a risk to the non-e10s behavior (default in 47).
Flags: needinfo?(mrbkap)
| Assignee | ||
Comment 20•9 years ago
|
||
(In reply to Ritu Kothari (:ritu) from comment #19)
> Hi Blake, could this impact non-e10s behavior? I just want to make sure even
> though we will uplift this to 47 for e10s experiments, it should not pose a
> risk to the non-e10s behavior (default in 47).
No, this is change to code that only runs in e10s builds.
Flags: needinfo?(mrbkap)
(In reply to Blake Kaplan (:mrbkap) (please use needinfo!) from comment #20)
> (In reply to Ritu Kothari (:ritu) from comment #19)
> > Hi Blake, could this impact non-e10s behavior? I just want to make sure even
> > though we will uplift this to 47 for e10s experiments, it should not pose a
> > risk to the non-e10s behavior (default in 47).
>
> No, this is change to code that only runs in e10s builds.
Got it. Thanks for the confirmation. Will approve the uplift.
Comment on attachment 8730475 [details] [diff] [review]
Patch v1.6
e10s related, Aurora47+
Attachment #8730475 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 23•9 years ago
|
||
| bugherder uplift | ||
You need to log in
before you can comment on or make changes to this bug.
Description
•