diff --git a/pwabuilder-sw.js b/pwabuilder-sw.js index 8e342f26..dd88e81e 100644 --- a/pwabuilder-sw.js +++ b/pwabuilder-sw.js @@ -12,7 +12,7 @@ const regexpKiwixDownloadLinks = /download\.kiwix\.org/i; // Pattern for ZIM file namespace - see https://wiki.openzim.org/wiki/ZIM_file_format#Namespaces // In our case, there is also the ZIM file name, used as a prefix in the URL -const regexpZIMUrlWithNamespace = /(?:^|\/)([^\/]+\/)([-ABIJMUVWX])\/(.+)/; +const regexpZIMUrlWithNamespace = /(?:^|\/)([^\/]+\/)([-ABCIJMUVWX])\/(.+)/; const CACHE = "kiwix-precache-" + appVersion; const precacheFiles = [ diff --git a/www/js/app.js b/www/js/app.js index 2ac126ca..ea003906 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -3075,14 +3075,14 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett // Pattern to find the path in a url var regexpPath = /^(.*\/)[^\/]+$/; // Pattern to find a ZIM URL (with its namespace) - see https://wiki.openzim.org/wiki/ZIM_file_format#Namespaces - var regexpZIMUrlWithNamespace = /^[.\/]*([-ABIJMUVWX]\/.+)$/; - // Regex below finds images, scripts, and stylesheets with ZIM-type metadata and image namespaces [kiwix-js #378] - // It first searches for ]*?\s)(?:src|href)(\s*=\s*["'])(?:\.\.\/|\/)+(?=[-IJ]\/)/ig; + var regexpZIMUrlWithNamespace = /^[./]*([-ABCIJMUVWX]\/.+)$/; + // Regex below finds images, scripts, stylesheets and tracks with ZIM-type metadata and image namespaces [kiwix-js #378]. + // It first searches for ]*?\s)(?:src|href)(\s*=\s*(["']))(?!http)(.+?)(?=\3|\?|#)/ig; // Regex below tests the html of an article for active content [kiwix-js #466] // It inspects every