зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1565574
- Update frontend callers of external protocol service to pass principal. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D93645
This commit is contained in:
Родитель
2f82080b18
Коммит
4bb1d2403f
|
@ -8179,7 +8179,10 @@ var MailIntegration = {
|
|||
"@mozilla.org/uriloader/external-protocol-service;1"
|
||||
].getService(Ci.nsIExternalProtocolService);
|
||||
if (extProtocolSvc) {
|
||||
extProtocolSvc.loadURI(aURL);
|
||||
extProtocolSvc.loadURI(
|
||||
aURL,
|
||||
Services.scriptSecurityManager.getSystemPrincipal()
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -702,7 +702,10 @@ var DownloadsCommon = {
|
|||
// the OS handler try to open the directory.
|
||||
Cc["@mozilla.org/uriloader/external-protocol-service;1"]
|
||||
.getService(Ci.nsIExternalProtocolService)
|
||||
.loadURI(NetUtil.newURI(aDirectory));
|
||||
.loadURI(
|
||||
NetUtil.newURI(aDirectory),
|
||||
Services.scriptSecurityManager.getSystemPrincipal()
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -870,7 +870,10 @@ var DownloadIntegration = {
|
|||
|
||||
// If our previous attempts failed, try sending it through
|
||||
// the system's external "file:" URL handler.
|
||||
gExternalProtocolService.loadURI(NetUtil.newURI(file));
|
||||
gExternalProtocolService.loadURI(
|
||||
NetUtil.newURI(file),
|
||||
Services.scriptSecurityManager.getSystemPrincipal()
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -938,7 +941,10 @@ var DownloadIntegration = {
|
|||
|
||||
// If launch also fails (probably because it's not implemented), let
|
||||
// the OS handler try to open the parent.
|
||||
gExternalProtocolService.loadURI(NetUtil.newURI(parent));
|
||||
gExternalProtocolService.loadURI(
|
||||
NetUtil.newURI(parent),
|
||||
Services.scriptSecurityManager.getSystemPrincipal()
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -1247,11 +1247,12 @@ function openURL(aURL) {
|
|||
"@mozilla.org/uriloader/external-protocol-service;1"
|
||||
].getService(Ci.nsIExternalProtocolService);
|
||||
|
||||
let recentWindow = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
if (!protocolSvc.isExposedProtocol(uri.scheme)) {
|
||||
// If we're not a browser, use the external protocol service to load the URI.
|
||||
protocolSvc.loadURI(uri);
|
||||
protocolSvc.loadURI(uri, recentWindow?.document.contentPrincipal);
|
||||
} else {
|
||||
var recentWindow = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (recentWindow) {
|
||||
recentWindow.openWebLinkIn(uri.spec, "tab", {
|
||||
triggeringPrincipal: recentWindow.document.contentPrincipal,
|
||||
|
|
|
@ -351,7 +351,7 @@
|
|||
// if the scheme is not an exposed protocol, then opening this link
|
||||
// should be deferred to the system's external protocol handler
|
||||
if (!protocolSvc.isExposedProtocol(uri.scheme)) {
|
||||
protocolSvc.loadURI(uri);
|
||||
protocolSvc.loadURI(uri, principal);
|
||||
aEvent.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче