diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-07-03 18:34:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-03 18:34:45 +0200 |
commit | a003b2be94b2f32b1e7527227a39e3714f8168a3 (patch) | |
tree | 40fa0705d2497265f8585fb859e62118928de540 /application/basilisk/base | |
parent | 51098794ed03568b7bf743739365f34840d93098 (diff) | |
parent | 1e48edfc97fa993372330c182bb4b0cd9c56b92e (diff) | |
download | UXP-a003b2be94b2f32b1e7527227a39e3714f8168a3.tar UXP-a003b2be94b2f32b1e7527227a39e3714f8168a3.tar.gz UXP-a003b2be94b2f32b1e7527227a39e3714f8168a3.tar.lz UXP-a003b2be94b2f32b1e7527227a39e3714f8168a3.tar.xz UXP-a003b2be94b2f32b1e7527227a39e3714f8168a3.zip |
Merge pull request #583 from janekptacijarabaci/_testBranch_pageInfo_permissions_indexedDB
Remove the UI for indexedDB in Page Info and Permissions Manager
Diffstat (limited to 'application/basilisk/base')
-rw-r--r-- | application/basilisk/base/content/browser.xul | 2 | ||||
-rw-r--r-- | application/basilisk/base/content/pageinfo/pageInfo.xul | 8 | ||||
-rw-r--r-- | application/basilisk/base/content/pageinfo/permissions.js | 66 |
3 files changed, 0 insertions, 76 deletions
diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul index 028df609f..982edfcd9 100644 --- a/application/basilisk/base/content/browser.xul +++ b/application/basilisk/base/content/browser.xul @@ -644,8 +644,6 @@ tooltiptext="&urlbar.webNotificationsBlocked.tooltip;"/> <image data-permission-id="camera" class="blocked-permission-icon camera-icon" role="button" tooltiptext="&urlbar.cameraBlocked.tooltip;"/> - <image data-permission-id="indexedDB" class="blocked-permission-icon indexedDB-icon" role="button" - tooltiptext="&urlbar.indexedDBBlocked.tooltip;"/> <image data-permission-id="microphone" class="blocked-permission-icon microphone-icon" role="button" tooltiptext="&urlbar.microphoneBlocked.tooltip;"/> <image data-permission-id="screen" class="blocked-permission-icon screen-icon" role="button" diff --git a/application/basilisk/base/content/pageinfo/pageInfo.xul b/application/basilisk/base/content/pageinfo/pageInfo.xul index 8352a8aa7..42b4dff65 100644 --- a/application/basilisk/base/content/pageinfo/pageInfo.xul +++ b/application/basilisk/base/content/pageinfo/pageInfo.xul @@ -280,14 +280,6 @@ </hbox> <vbox id="permList" flex="1"> - <hbox id="perm-indexedDB-extras"> - <spacer flex="1"/> - <vbox id="permIndexedDBStatusBox" pack="center"> - <label id="indexedDBStatus" control="indexedDBClear" hidden="true"/> - </vbox> - <button id="indexedDBClear" label="&permClearStorage;" hidden="true" - accesskey="&permClearStorage.accesskey;" onclick="onIndexedDBClear();"/> - </hbox> <vbox class="permission" id="perm-plugins-row"> <label class="permissionLabel" id="permPluginsLabel" value="&permPlugins;" control="pluginsRadioGroup"/> diff --git a/application/basilisk/base/content/pageinfo/permissions.js b/application/basilisk/base/content/pageinfo/permissions.js index 0e6b9cba1..1e73b6d65 100644 --- a/application/basilisk/base/content/pageinfo/permissions.js +++ b/application/basilisk/base/content/pageinfo/permissions.js @@ -5,8 +5,6 @@ Components.utils.import("resource:///modules/SitePermissions.jsm"); Components.utils.import("resource://gre/modules/BrowserUtils.jsm"); -const nsIQuotaManagerService = Components.interfaces.nsIQuotaManagerService; - var gPermURI; var gPermPrincipal; var gUsageRequest; @@ -90,10 +88,6 @@ function initRow(aPartId) perm = SitePermissions.getDefault(aPartId); } setRadioState(aPartId, perm); - - if (aPartId == "indexedDB") { - initIndexedDBRow(); - } } function createRow(aPartId) { @@ -188,66 +182,6 @@ function setRadioState(aPartId, aValue) } } -function initIndexedDBRow() -{ - let row = document.getElementById("perm-indexedDB-row"); - let extras = document.getElementById("perm-indexedDB-extras"); - - 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); - - Components.classes["@mozilla.org/serviceworkers/manager;1"] - .getService(Components.interfaces.nsIServiceWorkerManager) - .removeAndPropagate(gPermURI.host); - - SitePermissions.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); - } - - 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"); - } -} - function fillInPluginPermissionTemplate(aPluginName, aPermissionString) { let permPluginTemplate = document.getElementById("permPluginTemplate").cloneNode(true); permPluginTemplate.setAttribute("permString", aPermissionString); |