Closed
Bug 1169210
Opened 10 years ago
Closed 10 years ago
Can't call content service worker from chrome
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: ochameau, Assigned: jaoo)
References
Details
Attachments
(1 file, 2 obsolete files)
39 bytes,
text/x-review-board-request
|
Details |
Bug 1153407 is hitting this exception while writing tests, mochitest browser, used for testing devtools. We have to test the devtools by using chrome, but then we can't easily call the content service worker.
We are not trying to use chrome service worker but hit this exception just because the caller is chrome.
http://mxr.mozilla.org/mozilla-central/source/dom/workers/ServiceWorkerManager.cpp#1052
Couldn't we just prevent exposing navigator.serviceWorker on chrome?
Or only hit this assertion when accessing navigator.serviceWorker on a chrome document?
Ideally we shouldn't prevent service worker to work when the *caller* is chrome, but only when the *document* is chrome!
Or we could just make it work on chrome docs as weel if that's any easier ;)
Assignee | ||
Comment 1•10 years ago
|
||
Nikhil, what could we do here please? Thanks!
Flags: needinfo?(nsm.nikhil)
(In reply to Alexandre Poirot [:ochameau] from comment #0)
> Bug 1153407 is hitting this exception while writing tests, mochitest
> browser, used for testing devtools. We have to test the devtools by using
> chrome, but then we can't easily call the content service worker.
> We are not trying to use chrome service worker but hit this exception just
> because the caller is chrome.
> http://mxr.mozilla.org/mozilla-central/source/dom/workers/
> ServiceWorkerManager.cpp#1052
>
> Couldn't we just prevent exposing navigator.serviceWorker on chrome?
> Or only hit this assertion when accessing navigator.serviceWorker on a
> chrome document?
> Ideally we shouldn't prevent service worker to work when the *caller* is
> chrome, but only when the *document* is chrome!
> Or we could just make it work on chrome docs as weel if that's any easier ;)
Please remove that assert and add an assert that the window's document's principal is not the system principal.
Flags: needinfo?(nsm.nikhil)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jaoo
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•10 years ago
|
||
> Please remove that assert and add an assert that the window's document's
> principal is not the system principal.
Still not tested, but Is that what you meant please? Thanks!
Attachment #8612838 -
Flags: feedback?(nsm.nikhil)
Assignee | ||
Comment 4•10 years ago
|
||
This is the correct patch. Sorry.
Attachment #8612838 -
Attachment is obsolete: true
Attachment #8612838 -
Flags: feedback?(nsm.nikhil)
Attachment #8612839 -
Flags: feedback?(nsm.nikhil)
Comment 5•10 years ago
|
||
Comment on attachment 8612839 [details] [diff] [review]
WIP
Review of attachment 8612839 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/workers/ServiceWorkerManager.cpp
@@ +1208,5 @@
> + nsCOMPtr<nsIPrincipal> documentPrincipal = doc->NodePrincipal();
> + MOZ_ASSERT(documentPrincipal);
> +
> + PrincipalInfo info;
> + nsresult rv = PrincipalToPrincipalInfo(documentPrincipal, &info);
I think you just want:
MOZ_ASSERT(!nsContentUtils::IsSystemPrincipal(doc->NodePrincipal()));
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8612839 [details] [diff] [review]
WIP
(In reply to Ben Kelly [:bkelly] from comment #5)
> Comment on attachment 8612839 [details] [diff] [review]
> WIP
>
> Review of attachment 8612839 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/workers/ServiceWorkerManager.cpp
> @@ +1208,5 @@
> > + nsCOMPtr<nsIPrincipal> documentPrincipal = doc->NodePrincipal();
> > + MOZ_ASSERT(documentPrincipal);
> > +
> > + PrincipalInfo info;
> > + nsresult rv = PrincipalToPrincipalInfo(documentPrincipal, &info);
>
> I think you just want:
>
> MOZ_ASSERT(!nsContentUtils::IsSystemPrincipal(doc->NodePrincipal()));
Thanks Ben, much easier!
Attachment #8612839 -
Attachment is obsolete: true
Attachment #8612839 -
Flags: feedback?(nsm.nikhil)
Assignee | ||
Comment 7•10 years ago
|
||
Bug 1169210 - Can't call content service worker from chrome. r=nsm
Attachment #8612915 -
Flags: review?(nsm.nikhil)
Assignee | ||
Updated•10 years ago
|
Attachment #8612915 -
Flags: review?(nsm.nikhil)
Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8612915 [details]
MozReview Request: Bug 1169210 - Can't call content service worker from chrome. r=nsm
Bug 1169210 - Can't call content service worker from chrome. r=nsm
Assignee | ||
Updated•10 years ago
|
Attachment #8612915 -
Flags: review?(nsm.nikhil)
Assignee | ||
Comment 9•10 years ago
|
||
Comment on attachment 8612915 [details]
MozReview Request: Bug 1169210 - Can't call content service worker from chrome. r=nsm
Bug 1169210 - Can't call content service worker from chrome. r=nsm
Comment on attachment 8612915 [details]
MozReview Request: Bug 1169210 - Can't call content service worker from chrome. r=nsm
https://reviewboard.mozilla.org/r/9669/#review8427
Ship It!
::: dom/workers/ServiceWorkerManager.cpp:1060
(Diff revision 2)
> + // XXXnsm Don't allow service workers to register when the *document* is
No longer XXXnsm ;)
Attachment #8612915 -
Flags: review?(nsm.nikhil) → review+
Assignee | ||
Comment 11•10 years ago
|
||
Comment on attachment 8612915 [details]
MozReview Request: Bug 1169210 - Can't call content service worker from chrome. r=nsm
Bug 1169210 - Can't call content service worker from chrome. r=nsm
Attachment #8612915 -
Flags: review+
Assignee | ||
Comment 12•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 13•10 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in
before you can comment on or make changes to this bug.
Description
•