diff --git a/src/js/assets.js b/src/js/assets.js index bf15d395c..ba83f5d14 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -29,7 +29,8 @@ var reIsExternalPath = /^(?:[a-z-]+):\/\//, reIsUserAsset = /^user-/, - errorCantConnectTo = vAPI.i18n('errorCantConnectTo'); + errorCantConnectTo = vAPI.i18n('errorCantConnectTo'), + noopfunc = function(){}; var api = { }; @@ -716,7 +717,14 @@ var saveUserAsset = function(assetKey, content, callback) { /******************************************************************************/ -api.get = function(assetKey, callback) { +api.get = function(assetKey, options, callback) { + if ( typeof options === 'function' ) { + callback = options; + options = {}; + } else if ( typeof callback !== 'function' ) { + callback = noopfunc; + } + if ( assetKey === µBlock.userFiltersPath ) { readUserAsset(assetKey, callback); return; @@ -755,7 +763,7 @@ api.get = function(assetKey, callback) { onContentNotLoaded(); return; } - if ( reIsExternalPath.test(contentURL) ) { + if ( reIsExternalPath.test(contentURL) && options.dontCache !== true ) { assetCacheWrite(assetKey, { content: this.responseText, url: contentURL diff --git a/src/js/messaging.js b/src/js/messaging.js index cab4802fe..201ddbf28 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -57,7 +57,7 @@ var onMessage = function(request, sender, callback) { switch ( request.what ) { case 'getAssetContent': // https://github.com/chrisaljoudi/uBlock/issues/417 - µb.assets.get(request.url, callback); + µb.assets.get(request.url, { dontCache: true }, callback); return; case 'listsFromNetFilter':