mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Bug 1173523 - Part 3: Update PluginContent to use new API for nsIPermission
This commit is contained in:
parent
4238f1570d
commit
deb1d55084
2 changed files with 12 additions and 28 deletions
|
|
@ -470,28 +470,12 @@ var gPluginHandler = {
|
|||
}
|
||||
},
|
||||
|
||||
// Match the behaviour of nsPermissionManager
|
||||
_getHostFromPrincipal: function PH_getHostFromPrincipal(principal) {
|
||||
if (!principal.URI || principal.URI.schemeIs("moz-nullprincipal")) {
|
||||
return "(null)";
|
||||
}
|
||||
|
||||
try {
|
||||
if (principal.URI.host)
|
||||
return principal.URI.host;
|
||||
} catch (e) {}
|
||||
|
||||
return principal.origin;
|
||||
},
|
||||
|
||||
_makeCenterActions: function PH_makeCenterActions(notification) {
|
||||
let contentWindow = notification.browser.contentWindow;
|
||||
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
|
||||
let principal = contentWindow.document.nodePrincipal;
|
||||
// This matches the behavior of nsPermssionManager, used for display purposes only
|
||||
let principalHost = this._getHostFromPrincipal(principal);
|
||||
|
||||
let centerActions = [];
|
||||
let pluginsFound = new Set();
|
||||
|
|
@ -517,11 +501,11 @@ var gPluginHandler = {
|
|||
let permissionObj = Services.perms.
|
||||
getPermissionObject(principal, pluginInfo.permissionString, false);
|
||||
if (permissionObj) {
|
||||
pluginInfo.pluginPermissionHost = permissionObj.host;
|
||||
pluginInfo.pluginPermissionPrePath = permissionObj.principal.originNoSuffix;
|
||||
pluginInfo.pluginPermissionType = permissionObj.expireType;
|
||||
}
|
||||
else {
|
||||
pluginInfo.pluginPermissionHost = principalHost;
|
||||
pluginInfo.pluginPermissionPrePath = principal.originNoSuffix;
|
||||
pluginInfo.pluginPermissionType = undefined;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue