diff --git a/Chromium Web Store.crx b/Chromium Web Store.crx index 0c622a3..d5fa4d9 100644 Binary files a/Chromium Web Store.crx and b/Chromium Web Store.crx differ diff --git a/src/manifest.json b/src/manifest.json index 57eb073..271a668 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "author": "NeverDecaf", "manifest_version": 2, "name": "Chromium Web Store", - "version": "0.9.0", + "version": "0.9.1", "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqF/d41Q7agjkUzYq8ZGbQr8XW8mmEIMXOnR1uCTnYLL+Dm9Z+LO50xZukOISNy6zFxpI8ts/OGLsm+I2x9+UprUU4/EVdmxuwegFE6NBoEhHoRNYY0gbXZkaU8YY/XwzjVY/k18DDhl5NYPEnF6uq4Oyidg+xtd3W4+iGYczuOLER1Tp5y614zOTphcvFYhvUkCijQ6HT1TtRq/34SlFoRQqo4SFiLriK451xWIcfwiMLIekWrdoQa1v8dqIlMA3r6CKc0QykJpSYbiyormWiZ0hl2HLpkZ85mD9V0eDQ5RCtb6vkybK7INcq4yKQV4YkXhr9NpX9U4re4dlFQjEJQIDAQAB", "description": "Allow installing/updating extensions from chrome web store on chromium based browsers. Click badge to check for updates.", "permissions": [ diff --git a/src/scripts/popup.js b/src/scripts/popup.js index f8930c9..2702c45 100644 --- a/src/scripts/popup.js +++ b/src/scripts/popup.js @@ -37,10 +37,11 @@ checkForUpdates(function (updateCheck, installed_versions, appid, updatever, is_ }); appcontainer.appendChild(li); update_status.style.display = 'none'; +}, function (is_webstore, ext_name) { + let faildiv = document.createElement('h1'); + faildiv.setAttribute('class', 'updatefailure'); + faildiv.innerHTML = ext_name + ' Update Failed'; + appcontainer.appendChild(faildiv); }, function () { - update_status.innerHTML = 'UPDATE CHECK FAILED'; - update_status.setAttribute('id', 'updatefailure'); -}, function () { - if (update_status.getAttribute('id') != 'updatefailure') - update_status.innerHTML = 'All extensions are up to date!'; + update_status.innerHTML = 'All extensions are up to date!'; }); \ No newline at end of file diff --git a/src/scripts/util.js b/src/scripts/util.js index b44cf64..407499e 100644 --- a/src/scripts/util.js +++ b/src/scripts/util.js @@ -1,5 +1,6 @@ const chromeVersion = /Chrome\/([0-9.]+)/.exec(navigator.userAgent)[1]; const webstoreUrl = 'clients2.google.com/service/update2/crx'; + function checkForUpdates(update_callback = null, failure_callback = null, completed_callback = null) { chrome.management.getAll(function (e) { let default_options = { @@ -19,15 +20,21 @@ function checkForUpdates(update_callback = null, failure_callback = null, comple if (webstoreUrl == ex.updateUrl.replace(/^(?:https?:\/\/)?/i, "")) { updateUrl += '&x=id%3D' + ex.id + '%26uc'; } else if (settings.check_external_apps) { - updateUrls.push(ex.updateUrl); + updateUrls.push({ + 'url': ex.updateUrl, + 'name': ex.name + }); } installed_versions[ex.id] = ex; } }); if (settings.check_store_apps) - updateUrls.push(updateUrl); + updateUrls.push({ + 'url': updateUrl, + 'name': 'CWS Extensions' + }); - function getNewXhr(is_webstore) { + function getNewXhr(is_webstore, ext_name) { let xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState == 4) { @@ -60,7 +67,7 @@ function checkForUpdates(update_callback = null, failure_callback = null, comple }); } else { if (failure_callback) - failure_callback(); + failure_callback(is_webstore, ext_name); if (is_webstore) chrome.browserAction.setBadgeText({ text: "?" @@ -78,8 +85,8 @@ function checkForUpdates(update_callback = null, failure_callback = null, comple if (pending_updates == 0 && completed_callback) completed_callback(); updateUrls.forEach(function (uurl) { - xhr = getNewXhr(uurl == updateUrl); - xhr.open("GET", uurl, true); + xhr = getNewXhr(uurl.url == updateUrl, uurl.name); + xhr.open("GET", uurl.url, true); xhr.send(); xhr.onloadend = function () { pending_updates--; diff --git a/src/sheets/popup.css b/src/sheets/popup.css index d587488..6491049 100644 --- a/src/sheets/popup.css +++ b/src/sheets/popup.css @@ -72,7 +72,7 @@ a:hover { color:red; } -#updatefailure { +.updatefailure { font-weight: bold; background-color: red; } diff --git a/updates.xml b/updates.xml index af0134f..04236dc 100644 --- a/updates.xml +++ b/updates.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file