diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-02 14:33:20 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-02 14:33:20 +0100 |
commit | 43ddb9b8c08ac148a9b03f16f45ec2cb71243f81 (patch) | |
tree | 263aac81d8f55dab14e4f51cc8b09add3b950287 /devtools/client/storage/test/head.js | |
parent | 390894c822f1b163f16744646372a28c0d93a89e (diff) | |
download | UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar.gz UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar.lz UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.tar.xz UXP-43ddb9b8c08ac148a9b03f16f45ec2cb71243f81.zip |
Bug 1276339: Storage inspector doesn't work on chrome:// pages and web extensions
Issue #31
Diffstat (limited to 'devtools/client/storage/test/head.js')
-rw-r--r-- | devtools/client/storage/test/head.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/devtools/client/storage/test/head.js b/devtools/client/storage/test/head.js index 894056c9e..0d7d13e17 100644 --- a/devtools/client/storage/test/head.js +++ b/devtools/client/storage/test/head.js @@ -879,3 +879,19 @@ var focusSearchBoxUsingShortcut = Task.async(function* (panelWin, callback) { function getCookieId(name, domain, path) { return `${name}${SEPARATOR_GUID}${domain}${SEPARATOR_GUID}${path}`; } + +function setPermission(url, permission) { + const nsIPermissionManager = Components.interfaces.nsIPermissionManager; + + let uri = Components.classes["@mozilla.org/network/io-service;1"] + .getService(Components.interfaces.nsIIOService) + .newURI(url, null, null); + let ssm = Components.classes["@mozilla.org/scriptsecuritymanager;1"] + .getService(Ci.nsIScriptSecurityManager); + let principal = ssm.createCodebasePrincipal(uri, {}); + + Components.classes["@mozilla.org/permissionmanager;1"] + .getService(nsIPermissionManager) + .addFromPrincipal(principal, permission, + nsIPermissionManager.ALLOW_ACTION); +} |