]> git.wh0rd.org - chrome-ext/tabs-backup.git/blobdiff - popup.js
stop using getURL
[chrome-ext/tabs-backup.git] / popup.js
index 7c5f2f5e3de8f1c8b51440dfbaa04859ad1535b4..c8b955b00de72b4ae839aa1ea6027ef55d8d431e 100644 (file)
--- a/popup.js
+++ b/popup.js
@@ -34,11 +34,11 @@ document.addEventListener('DOMContentLoaded', function () {
 });
 
 function menu_ShowOptions () {
-       chrome.tabs.create({url:chrome.extension.getURL("options.html")});
+       chrome.runtime.openOptionsPage();
 }
 
 function menu_ShowAdvancedView() {
-       chrome.tabs.create({url:chrome.extension.getURL("advanced.html")});
+       chrome.tabs.create({url: "/advanced.html"});
 }
 
 function menu_ShowOlderBackups () {
@@ -298,9 +298,9 @@ function updateStorageInfo() {
                if (bytesInUse < 1024) {
                        storageText = bytesInUse.toFixed(2) + " bytes";
                } else if (bytesInUse < 1024 * 1024) {
-                       storageText = (bytesInUse / 1024).toFixed(2)  + " Kb";
+                       storageText = (bytesInUse / 1024).toFixed(2)  + " KiB";
                } else {
-                       storageText = (bytesInUse / (1024 * 1024)).toFixed(2) + " Mb";
+                       storageText = (bytesInUse / (1024 * 1024)).toFixed(2) + " MiB";
                }
 
                var storageSpan = document.getElementById("storageSpan");
@@ -338,16 +338,3 @@ function menu_backupNow() {
 function menu_restoreNow() {
        chrome.runtime.getBackgroundPage((bg) => bg.restoreNow('full_backup'));
 }
-
-//document.onload(function () {
-//var a = document.getElementById("myid");
-//a.innerHTML = "ciaociao";
-//});
-
-/*
-var storageLocal = chrome.storage.local;
-storageLocal.getBytesInUse(null, function(bytesInUse) {
-       var elem = document.createElement("div");
-       elem.innerHTML = "<b>BYTES IN USE: " + bytesInUse + "</b><br />";
-       document.body.appendChild(elem);
-});*/