GetTopWindowURI should return the URI that a service worker is registered to instead of null
Categories
(Toolkit :: Safe Browsing, enhancement, P2)
Tracking
()
People
(Reporter: erahm, Assigned: dimi)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged] tp-leak)
Attachments
(8 files)
46.47 KB,
image/png
|
Details | |
28.62 KB,
image/png
|
Details | |
40.23 KB,
image/png
|
Details | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Comment 1•8 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
Comment 19•7 years ago
|
||
Comment 20•7 years ago
|
||
Comment 21•7 years ago
|
||
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
Comment 24•7 years ago
|
||
Comment 25•7 years ago
|
||
Comment 26•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Comment 27•7 years ago
|
||
Comment 28•7 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 29•6 years ago
|
||
Besides the issue that we want to fix by implementing the solution in Comment 23, I found another one is that we don't get correct "useTrackingProtection" attribute in LoadContext[1] for channels triggered by ServiceWorker.(I tested Fetch in ServiceWorker script)
The reason is that in Bug 1322576, we change the behavior from using a global tracking protection preference to setting it through individual docshell[2]. But in the case of ServiceWorker, the LoadGroup is not from docshell, it is empty[3][4], so the "useTrackingProtection" attribute is always false. So I guess we need to get the information from docshell somehow while creating service worker?
Hi Andrew,
I am not sure how to fix this in service worker, do you have any suggestion?
If the comment above is not clear, please let me know and I'll provide more information, thanks!
[1] https://searchfox.org/mozilla-central/rev/94c6b5f06d2464f6780a52f32e917d25ddc30d6b/docshell/base/nsILoadContext.idl#93
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1322576#c2
[3] https://searchfox.org/mozilla-central/rev/94c6b5f06d2464f6780a52f32e917d25ddc30d6b/dom/serviceworkers/ServiceWorkerPrivate.cpp#1692
[4] https://searchfox.org/mozilla-central/rev/94c6b5f06d2464f6780a52f32e917d25ddc30d6b/dom/workers/WorkerLoadInfo.cpp#371
Comment 30•6 years ago
|
||
Is useTrackingProtection something that could live on CookieSettings? It seems like that's the right place and already has the right semantics and life-cycle.
Comment 31•6 years ago
|
||
Yes, it makes sense. The main difference is that nsICookieSettings is not exposed by the docShell, but by the document.
I don't have time to work on it right now. Dimi, is it something you would like to take?
Assignee | ||
Comment 32•6 years ago
|
||
(In reply to Andrea Marchesini [:baku] from comment #31)
Yes, it makes sense. The main difference is that nsICookieSettings is not exposed by the docShell, but by the document.
I don't have time to work on it right now. Dimi, is it something you would like to take?
Yes, I'll work on it :)
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 33•5 years ago
|
||
We use whether channel->GetTopWindowURI returns a failure to determin
if the channel is a top-level load. However, channels loaded by service
worker or appcache don't have top-level window.
This patch use TYPE_DOCUMENT to determin whether it is a top-level load.
This patch also adds UrlClassifierCommon::GetTopWindowURI to print debug message
because nsIChannel::GetTopWindowURI is not fission-compatible.
Assignee | ||
Comment 34•5 years ago
|
||
When a channel is initiated from sharedworker or service worker, we use
worker's origin as the top-level uri.
Depends on D80182
Assignee | ||
Comment 35•5 years ago
|
||
Channels loaded by service worker don't have loadcontext, so we don't
apply tracking protection on them.
Depends on D80183
Assignee | ||
Comment 36•5 years ago
|
||
This patches does the following:
- Test fetch in service worker should be classified.
- Test requests should not be classified when it is whitelisted.
- Test requests should not be classified when it is a first-party.
Depends on D80184
Comment 37•5 years ago
|
||
Comment 38•5 years ago
|
||
Backed out 4 changesets (Bug 1437626) for causing ES lint failure CLOSED TREE
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=308285667&repo=autoland&lineNumber=251
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=308285637&repo=autoland&lineNumber=98
Backout: https://hg.mozilla.org/integration/autoland/rev/032fb096dde312f732d2f06bb9b94f8a2d104907
Assignee | ||
Comment 39•5 years ago
|
||
ShouldEnableClassifier checks two things:
- If AddOn can load the channel
- If the classified channel is top-level.
For the first point, we added the check in Bug 1308640, and I think the
idea is only for tracking protection to not block channels when
extensions have permission on the channels' domain.
For annotation features, we should always annotate a channel regardless of whether
it is controlled by extensions (also for ETP).
And since we use first-party classification flag in channels, so we
should also annotate channel no matter it is top-level, first-party or
third-party.
So this patch removes calling ShouldEnableClassifier in annotation
features and also rename ShouldEnableClassifier to
ShouldEnableProtectionForChannel to make the idea more clear.
Comment 40•5 years ago
|
||
Comment 41•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1bf037a20722
https://hg.mozilla.org/mozilla-central/rev/2ecb2e44bbde
https://hg.mozilla.org/mozilla-central/rev/136507c80fe5
https://hg.mozilla.org/mozilla-central/rev/923c1985eec2
https://hg.mozilla.org/mozilla-central/rev/72cbc5b44e74
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Description
•