This commit is contained in:
Raymond Hill 2018-03-23 15:03:29 -04:00
parent a3daa804d4
commit d9161aeffa
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 8 additions and 2 deletions

View File

@ -490,7 +490,7 @@ RedirectEngine.prototype.resourcesFromString = function(text) {
/******************************************************************************/
var resourcesSelfieVersion = 2;
var resourcesSelfieVersion = 3;
RedirectEngine.prototype.selfieFromResources = function() {
vAPI.cacheStorage.set({

View File

@ -20,6 +20,9 @@ with open('./src/web_accessible_resources/to-import.txt', 'r') as f:
if len(line) != 0 and line[0] != '#':
to_import.add(line)
# https://github.com/gorhill/uBlock/issues/3636
safe_exts = { 'javascript': 'js' }
imported = []
# scan the file until a resource to import is found
@ -40,7 +43,10 @@ def safe_filename_from_token(token, mime):
# extract file extension from mime
match = re.search('^[^/]+/([^\s;]+)', mime)
if match:
name += '.' + match.group(1)
ext = match.group(1)
if ext in safe_exts:
ext = safe_exts[ext]
name += '.' + ext
return name
def import_resource(f, token, mime):