Loading chrome pages blocked by about: policies never complete
Categories
(Firefox :: Enterprise Policies, defect, P3)
Tracking
()
People
(Reporter: mkaply, Assigned: mkaply)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
When about: pages are blocked, we block all chrome URLs loading in the main browser window (not optimal, I'm going to make it better)
Starting with when bug 1362774 landed, when you try to load these pages, instead of just loading as blank, they stay spinning forever.
These pages are blocked in content policy:
So something seems to have changed related to that.
To recreate, add a policies.json in a distribution directory:
{
"policies": {
"BlockAboutConfig": true
}
}
Restart the browser and navigate to
chrome://global/content/config.xul
Comment 1•5 years ago
|
||
Seems like we should load an error page in this case, not load about:blank.
Assignee | ||
Comment 2•5 years ago
|
||
We're not loading about:blank, we're just rejecting the request.
Assignee | ||
Comment 3•5 years ago
|
||
Seems like we should load an error page in this case, not load about:blank.
My answer was unhelpful. In the about case, it was pretty easy to show an error message because we are just affecting the redirection.
For loading chrome URLs directly, the nsIContentPolicy was the only think we could think of.
Is it possible to redirect the channel in content policy?
Assignee | ||
Comment 4•5 years ago
|
||
How wrong would it be to just do:
loadInfo.loadingContext.contentWindow.location.href = "about:neterror?e=blockedByPolicy";
in the content policy? We're really looking at an edge case here.
Comment 5•5 years ago
|
||
(In reply to Mike Kaply [:mkaply] from comment #3)
Seems like we should load an error page in this case, not load about:blank.
My answer was unhelpful. In the about case, it was pretty easy to show an error message because we are just affecting the redirection.
For loading chrome URLs directly, the nsIContentPolicy was the only think we could think of.
Is it possible to redirect the channel in content policy?
I don't know what the nsIContentPolicy thing is or how it works, so I don't know if there's a better way than:
(In reply to Mike Kaply [:mkaply] from comment #4)
How wrong would it be to just do:
loadInfo.loadingContext.contentWindow.location.href = "about:neterror?e=blockedByPolicy";
FWIW, I suspect this isn't OK given this comment: https://searchfox.org/mozilla-central/source/dom/base/nsIContentPolicy.idl#436-447 .
in the content policy? We're really looking at an edge case here.
It'd be better to have us handle failures in shouldLoad
correctly. I'm pretty sure there are other edgecases already documented on bugzilla that hit this case.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Now that I've added support for policy errors in nsiContentPolicy, this should be straightforward to do.
Assignee | ||
Comment 7•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 9•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Updated•3 years ago
|
Description
•