Bug 1553265 - add a document.addCertException function to about:certerror pages and use it there; also treat GeckoView error pages as CallerIsTrusted(Net|Cert)Error; r=snorp,johannh,baku
Add a document.addCertException function to about:certerror pages, and use it on the desktop certerror page.
Also, as the CallerIsTrusted* functions expect URLs like about:certerror, but GeckoView error pages are data URLs, and so need to be handled differently for these special error-page methods to be exposed on their documents.
Example usage of document.addCertException:
document.addCertException(
true|false /* true == temporary, false == permanent */
).then(
() => {
location.reload();
},
err => {
console.error(err);
}
);
Differential Revision: https://phabricator.services.mozilla.com/D56974
This commit is contained in:
@@ -511,7 +511,15 @@ function initPageCertError() {
|
||||
}
|
||||
|
||||
function addCertException() {
|
||||
RPMSendAsyncMessage("AddCertException", { location: document.location.href });
|
||||
const isPermanent =
|
||||
!RPMIsWindowPrivate() &&
|
||||
RPMGetBoolPref("security.certerrors.permanentOverride");
|
||||
document.addCertException(!isPermanent).then(
|
||||
() => {
|
||||
location.reload();
|
||||
},
|
||||
err => {}
|
||||
);
|
||||
}
|
||||
|
||||
function onReturnButtonClick(e) {
|
||||
|
||||
Reference in New Issue
Block a user