1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 var unsafeAboutModule
= {
8 QueryInterface
: ChromeUtils
.generateQI(["nsIAboutModule"]),
9 newChannel(aURI
, aLoadInfo
) {
10 var uri
= Services
.io
.newURI("about:blank");
11 let chan
= Services
.io
.newChannelFromURIWithLoadInfo(uri
, aLoadInfo
);
12 chan
.owner
= Services
.scriptSecurityManager
.getSystemPrincipal();
16 return Ci
.nsIAboutModule
.URI_SAFE_FOR_UNTRUSTED_CONTENT
;
21 createInstance(aIID
) {
22 return unsafeAboutModule
.QueryInterface(aIID
);
24 QueryInterface
: ChromeUtils
.generateQI(["nsIFactory"]),
28 let registrar
= Components
.manager
.QueryInterface(Ci
.nsIComponentRegistrar
);
29 let classID
= Services
.uuid
.generateUUID();
30 registrar
.registerFactory(
33 "@mozilla.org/network/protocol/about;1?what=unsafe",
37 let aboutUnsafeChan
= NetUtil
.newChannel({
39 loadUsingSystemPrincipal
: true,
44 aboutUnsafeChan
.owner
,
45 "URI_SAFE_FOR_UNTRUSTED_CONTENT channel has no owner"
48 registrar
.unregisterFactory(classID
, factory
);