Skip to content
This repository was archived by the owner on Oct 24, 2020. It is now read-only.

Commit 2371a4a

Browse files
author
Gaming4JC
committed
Use newChannel2 to remove deprecated warning
1 parent 3647b00 commit 2371a4a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/chrome/content/code/HTTPSRules.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,13 @@ const RuleWriter = {
247247
},
248248

249249
readFromUrl: function (url) {
250-
var ios = CC['@mozilla.org/network/io-service;1']
251-
.getService(CI.nsIIOService);
252250
var encoding = "UTF-8";
253-
var channel = ios.newChannel(url, encoding, null);
251+
var ios = Services.io;
252+
var channel = ios.newChannel2(url, encoding, null, null,
253+
Services.scriptSecurityManager.getSystemPrincipal(),
254+
null,
255+
Components.interfaces.nsILoadInfo.SEC_NORMAL,
256+
Components.interfaces.nsIContentPolicy.TYPE_OTHER);
254257
var stream = channel.open();
255258
var streamSize = stream.available();
256259

0 commit comments

Comments
 (0)