Can't change permissions from network/cert error pages using page info dialog
Categories
(Firefox :: Page Info Window, defect, P3)
Tracking
()
People
(Reporter: Gijs, Assigned: danielleleb12)
Details
Attachments
(1 file)
|
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
Example STR:
- clean profile
- open google maps
- click the "my location" button in the bottom right to get google to prompt you if it can have access to your location
- accept
- file > work offline (or turn off internet connection or whatever)
- reopen the page somehow (you will get a network error page)
- open site identity popup
ER:
you can see that you've given https://www.google.com/ geolocation permission and can revoke this permission
AR:
no permissions are listed.
(Noted in https://phabricator.services.mozilla.com/D18586#475945 )
| Comment hidden (obsolete) |
Comment 2•7 years ago
|
||
Oh, I misread this - this bug is for Desktop. In that case never mind.
Updated•7 years ago
|
Comment 3•7 years ago
|
||
Hey Danielle, this is very similar to bug 1501955, I think, would you like to take a stab at it?
Thanks!
| Assignee | ||
Comment 4•7 years ago
|
||
| Assignee | ||
Comment 5•7 years ago
|
||
Hi Johann, just created the patch, but now I realize that the "Permission for:" value is displaying as "about:" rather than "https://www.google.com" - working on that now.
| Assignee | ||
Comment 6•7 years ago
|
||
I'm having some trouble getting the correct value for the host (the issue I mentioned in my previous comment - "Permissions for: https://www.google.com). The value being used currently is gPermURI.displayPrePath, which of course is not the value that should be displayed when on the "about:neterror/certerror" pages. I've tried various ways of getting the host value off of gPermURI (gPermURI.host/hostName/displayHost), as well as document/window.location and gPermPrincipal.URI.host/hostName - but still am unable to get the correct value.
Is it possible to get that value with the information currently being provided to onLoadPermission (uri and principal) - or should I be passing something else if it is a about:certerror/neterror page?
| Reporter | ||
Comment 7•7 years ago
|
||
Hi! This bug is actually to do with the site identity popup (the thing that shows up if you click the lock and/or (i) icon in the location bar), not the page info dialog. The code lives in browser-siteIdentity.js .
Fixing the page info dialog would also be useful, and we could do it in one patch if it's easy... For the page info case, I think we need to pass more info to onLoadPermission from the code that calls it in pageInfo.js . It looks like windowInfo has the host name, but we still wouldn't have a principal. I'm not sure what the best way of obtaining it would be... Johann, can you help?
Comment 8•7 years ago
|
||
Oh, sorry, that was my bad, I thought this was about page info, but of course it's in the site identity component.
I can not reproduce the problem with the site identity popup, Gijs, are you sure that you've given permanent permission (remember this decision)? Otherwise the permission will not be shown in any case...
Thanks!
Comment 9•7 years ago
|
||
(In reply to danielleleb12 from comment #6)
I'm having some trouble getting the correct value for the host (the issue I mentioned in my previous comment - "Permissions for: https://www.google.com). The value being used currently is
gPermURI.displayPrePath, which of course is not the value that should be displayed when on the "about:neterror/certerror" pages. I've tried various ways of getting the host value off ofgPermURI(gPermURI.host/hostName/displayHost), as well asdocument/window.locationandgPermPrincipal.URI.host/hostName- but still am unable to get the correct value.Is it possible to get that value with the information currently being provided to
onLoadPermission(uri and principal) - or should I be passing something else if it is aabout:certerror/neterrorpage?
Yeah, I think browser.currentURI is what you're looking to pass with onLoadPermission, as well as a new principal based on that URI, which you can create with Services.scriptSecurityManager.createCodebasePrincipal(uri, {}); (technically we're losing data that way but it's all a bit messed up anyway and won't matter in practice right now).
Comment 10•7 years ago
|
||
Whatever we end up fixing here (page info and/or site identity), thanks for working on it :)
| Reporter | ||
Comment 11•7 years ago
|
||
(In reply to Johann Hofmann [:johannh] from comment #8)
Oh, sorry, that was my bad, I thought this was about page info, but of course it's in the site identity component.
I can not reproduce the problem with the site identity popup, Gijs, are you sure that you've given permanent permission (remember this decision)? Otherwise the permission will not be shown in any case...
Thanks!
Uh, wow, that's... yep. OK.
So let's morph this to be about the page info window then...
(In reply to Johann Hofmann [:johannh] from comment #9)
(In reply to danielleleb12 from comment #6)
Yeah, I think
browser.currentURIis what you're looking to pass withonLoadPermission, as well as a new principal based on that URI, which you can create withServices.scriptSecurityManager.createCodebasePrincipal(uri, {});(technically we're losing data that way but it's all a bit messed up anyway and won't matter in practice right now).
For the principal creation, I guess we could use the userContextId from the tab to make sure we get the right container ?
Comment 12•7 years ago
|
||
(In reply to :Gijs (he/him) from comment #11)
For the principal creation, I guess we could use the userContextId from the tab to make sure we get the right container ?
We could, though permissions are currently stripped of OAs anyway, so it won't make a difference at the moment https://searchfox.org/mozilla-central/rev/358f816f63da072145c593e9e2ac36b7250ecd25/extensions/cookie/nsPermissionManager.cpp#162-164
Bug 1330467 is trying to get the first party attribute un-stripped at least, but I don't think first party context matters for error pages.
OTOH it might be nice to future-proof this code and it's easy to do, I think. If I'm not missing something we could just do:
Services.scriptSecurityManager.createCodebasePrincipal(browser.currentURI, browser.contentPrincipal.originAttributes);
Unless there's a reason why we need it from the tab instead.
Comment 13•7 years ago
|
||
(Thanks for confirming that it works for site identity :)
| Assignee | ||
Comment 14•7 years ago
|
||
Thank you both for all of the info!
I'm updating the patch now.
| Assignee | ||
Updated•7 years ago
|
Comment 15•7 years ago
|
||
Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/990ff091adb3
Adds ability to change permissions on network/cert error pages. r=johannh,Gijs
Comment 16•7 years ago
|
||
| bugherder | ||
Comment 18•7 years ago
|
||
Comment on attachment 9052031 [details]
Bug 1525941 - Adds ability to change permissions on network/cert error pages.
Beta/Release Uplift Approval Request
- Feature/Bug causing the regression: Very old
- User impact if declined: Users can not change permissions via page info on certificate error pages.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See comment 0
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Well understood patch, a few lines of JS, limited to rarely used page info dialog, has full test coverage.
- String changes made/needed: None
Updated•7 years ago
|
Comment 19•7 years ago
•
|
||
Old regression and P3, the patch looks not risky but let's get it verified by QA before uplifting.
Updated•7 years ago
|
Comment 20•7 years ago
|
||
Verified, that the issue is not reproducible on Nightly 68(20190416095014), on Win 10 x64, Ubuntu 18.01 and MacOS 10.14
Comment 21•7 years ago
|
||
Comment on attachment 9052031 [details]
Bug 1525941 - Adds ability to change permissions on network/cert error pages.
Low risk patch, uplift approved for 67 beta 12, thanks.
Comment 22•7 years ago
|
||
| bugherder uplift | ||
Comment 23•7 years ago
|
||
Verified, that the issue is not reproducible on Beta 67.0b12(20190418160535), on Win 10 x64, Ubuntu 18.01 and MacOS 10.14
Description
•