Merge pull request #1137 from lv7777/fix-#1115

Migrate to newChannel2. This is to suppress deprecation warnings:

Warning: 'nsIOService::NewChannel()' deprecated, please use 'nsIOService::NewChannel2()'
Warning: 'nsIAboutModule->newChannel(aURI)' deprecated, please use 'nsIAboutModule->newChannel(aURI, aLoadInfo)'
This commit is contained in:
YUKI "Piro" Hiroshi 2016-06-22 18:48:56 +09:00 committed by GitHub
commit 7c88cd0ab5

View File

@ -47,7 +47,23 @@ AboutGroup.prototype = {
newChannel : function(aURI)
{
return Services.io.newChannel('chrome://treestyletab/content/group.xul', null, null);
const version = Services.appinfo.platformVersion;
const comp = Services.vc.compare('48.*',version);
if( comp > 0 ){
return Services.io.newChannel('chrome://treestyletab/content/group.xul', null, null);
}else{
return Services.io.newChannel2(
'chrome://treestyletab/content/group.xul',
null,
null,
null,
Services.scriptSecurityManager.getSystemPrincipal(),
Services.scriptSecurityManager.getSystemPrincipal(),
Components.interfaces.nsILoadInfo.SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
Components.interfaces.nsIContentPolicy.TYPE_OTHER
);
}
},
getURIFlags : function(aURI)