Bug 1087744: Make JS callers of ios.newChannel call ios.newChannel2 in toolkit/content/ (r=bsmedberg)

This commit is contained in:
Christoph Kerschbaumer 2015-02-10 20:50:02 -08:00
parent 14bf115903
commit 05474eb7ca

View File

@ -1102,6 +1102,8 @@ function getCharsetforSave(aDocument)
* Open a URL from chrome, determining if we can handle it internally or need to
* launch an external application to handle it.
* @param aURL The URL to be opened
*
* WARNING: Please note that openURL() does not perform any content security checks!!!
*/
function openURL(aURL)
{
@ -1158,7 +1160,12 @@ function openURL(aURL)
}
}
var channel = Services.io.newChannelFromURI(uri);
var channel = Services.io.newChannelFromURI2(uri,
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
var uriLoader = Components.classes["@mozilla.org/uriloader;1"]
.getService(Components.interfaces.nsIURILoader);
uriLoader.openURI(channel,