mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
45adfbf2c8
--HG-- extra : rebase_source : 98337b6a8c07d05e8c961a452dd05a7d75c3c60b
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
const Cc = Components.classes;
|
|
const Ci = Components.interfaces;
|
|
const Cr = Components.results;
|
|
const Cu = Components.utils;
|
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
/**
|
|
* This component's job is to prevent "bad cert" security dialogs from
|
|
* being shown to the user when in XHR backgroundRequest mode. This
|
|
* causes the request to simply fail if the certificate is bad.
|
|
*/
|
|
function BadCertHandler() {
|
|
}
|
|
|
|
BadCertHandler.prototype = {
|
|
|
|
// Suppress any certificate errors
|
|
notifyCertProblem: function(socketInfo, status, targetSite) {
|
|
return true;
|
|
},
|
|
|
|
// Suppress any ssl errors
|
|
notifySSLError: function(socketInfo, error, targetSite) {
|
|
return true;
|
|
},
|
|
|
|
// nsIInterfaceRequestor
|
|
getInterface: function(iid) {
|
|
return this.QueryInterface(iid);
|
|
},
|
|
|
|
// nsISupports
|
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBadCertListener2,
|
|
Ci.nsISSLErrorListener,
|
|
Ci.nsIInterfaceRequestor]),
|
|
|
|
classID: Components.ID("{dbded6ec-edbf-4054-a834-287b82c260f9}"),
|
|
};
|
|
|
|
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BadCertHandler]);
|