diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-02 21:20:26 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-02 21:20:26 +0200 |
commit | 1e48edfc97fa993372330c182bb4b0cd9c56b92e (patch) | |
tree | c0f6601ea9a83affce467e338e498e747e33983a /application/palemoon/base/content/pageinfo/permissions.js | |
parent | dc4e425944146f495b9af9a2924357c1acc733f7 (diff) | |
download | UXP-1e48edfc97fa993372330c182bb4b0cd9c56b92e.tar UXP-1e48edfc97fa993372330c182bb4b0cd9c56b92e.tar.gz UXP-1e48edfc97fa993372330c182bb4b0cd9c56b92e.tar.lz UXP-1e48edfc97fa993372330c182bb4b0cd9c56b92e.tar.xz UXP-1e48edfc97fa993372330c182bb4b0cd9c56b92e.zip |
Bug 1334411 - Remove the UI for indexedDB in Page Info and Permissions Manager
Diffstat (limited to 'application/palemoon/base/content/pageinfo/permissions.js')
-rw-r--r-- | application/palemoon/base/content/pageinfo/permissions.js | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/application/palemoon/base/content/pageinfo/permissions.js b/application/palemoon/base/content/pageinfo/permissions.js index e0fb01f76..5d25a800d 100644 --- a/application/palemoon/base/content/pageinfo/permissions.js +++ b/application/palemoon/base/content/pageinfo/permissions.js @@ -12,8 +12,6 @@ const IMAGE_DENY = 2; const COOKIE_DENY = 2; const COOKIE_SESSION = 2; -const nsIQuotaManagerService = Components.interfaces.nsIQuotaManagerService; - var gPermURI; var gPermPrincipal; var gPrefs; @@ -65,13 +63,6 @@ var gPermObj = { } return ALLOW; }, - indexedDB: function getIndexedDBDefaultPermissions() - { - if (!gPrefs.getBoolPref("dom.indexedDB.enabled")) { - return DENY; - } - return UNKNOWN; - }, plugins: function getPluginsDefaultPermissions() { return UNKNOWN; @@ -161,10 +152,6 @@ function initRow(aPartId) perm = gPermObj[aPartId](); } setRadioState(aPartId, perm); - - if (aPartId == "indexedDB") { - initIndexedDBRow(); - } } function onCheckboxClick(aPartId) @@ -211,65 +198,6 @@ function setRadioState(aPartId, aValue) radio.radioGroup.selectedItem = radio; } -function initIndexedDBRow() -{ - let row = document.getElementById("permIndexedDBRow"); - let extras = document.getElementById("permIndexedDBExtras"); - - row.appendChild(extras); - - var quotaManagerService = - Components.classes["@mozilla.org/dom/quota-manager-service;1"] - .getService(nsIQuotaManagerService); - - gUsageRequest = - quotaManagerService.getUsageForPrincipal(gPermPrincipal, - onIndexedDBUsageCallback); - - var status = document.getElementById("indexedDBStatus"); - var button = document.getElementById("indexedDBClear"); - - status.value = ""; - status.setAttribute("hidden", "true"); - button.setAttribute("hidden", "true"); -} - -function onIndexedDBClear() -{ - Components.classes["@mozilla.org/dom/quota-manager-service;1"] - .getService(nsIQuotaManagerService) - .clearStoragesForPrincipal(gPermPrincipal); - - var permissionManager = Components.classes[PERMISSION_CONTRACTID] - .getService(nsIPermissionManager); - permissionManager.remove(gPermURI, "indexedDB"); - initIndexedDBRow(); -} - -function onIndexedDBUsageCallback(request) -{ - let uri = request.principal.URI; - if (!uri.equals(gPermURI)) { - throw new Error("Callback received for bad URI: " + uri.spec); - } - - let usage = request.result.usage; - if (usage) { - if (!("DownloadUtils" in window)) { - Components.utils.import("resource://gre/modules/DownloadUtils.jsm"); - } - - var status = document.getElementById("indexedDBStatus"); - var button = document.getElementById("indexedDBClear"); - - status.value = - gBundle.getFormattedString("indexedDBUsage", - DownloadUtils.convertByteUnits(usage)); - status.removeAttribute("hidden"); - button.removeAttribute("hidden"); - } -} - // XXX copied this from browser-plugins.js - is there a way to share? function makeNicePluginName(aName) { if (aName == "Shockwave Flash") |