From 66ea8355f2e83d6a08ff0716ab4ab6ee1b51aab9 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 23 Jul 2014 12:53:56 -0400 Subject: [PATCH] this fixes /gorhill/httpswitchboard/issues/381 --- js/assets.js | 17 +++++++++++------ manifest.json | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/js/assets.js b/js/assets.js index 338b5c232..640230a12 100644 --- a/js/assets.js +++ b/js/assets.js @@ -79,13 +79,18 @@ var cachedAssetsManager = (function() { return; } var onLoaded = function(bin) { - if ( chrome.runtime.lastError ) { - console.error( - 'µBlock> cachedAssetsManager> getEntries():', - chrome.runtime.lastError.message - ); + // https://github.com/gorhill/httpswitchboard/issues/381 + // Maybe the index was requested multiple times and already + // fetched by one of the occurrences. + if ( entries === null ) { + if ( chrome.runtime.lastError ) { + console.error( + 'µBlock> cachedAssetsManager> getEntries():', + chrome.runtime.lastError.message + ); + } + entries = bin.cached_asset_entries || {}; } - entries = bin.cached_asset_entries || {}; callback(entries); }; chrome.storage.local.get('cached_asset_entries', onLoaded); diff --git a/manifest.json b/manifest.json index ed8404635..d9eaaee4c 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "__MSG_extName__", "short_name": "µBlock", - "version": "0.2.3.4", + "version": "0.2.3.5", "description": "__MSG_extShortDesc__", "icons": { "16": "img/icon_16.png",