diff --git a/CHANGELOG.md b/CHANGELOG.md
index a45e1198..a89cd785 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
## In-progress release 1.9.8
+* FEATURE: Experimental support for reading Zimit ZIM archives
* BUILD: Nightly builds of main app are now uploaded to a new server (with sftp instead of ssh)
* BUILD: Deploy PWA image on a k8s cluster
* BUILD: PWA images are now uploaded to ghcr.io instead of Docker Hub
diff --git a/package.json b/package.json
index 3414f813..db6b6e6f 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "kiwix-js-electron",
"productName": "Kiwix JS Electron",
- "version": "1.9.7-E",
+ "version": "1.9.8-E",
"description": "Kiwix JS packaged for the Electron framework",
"main": "main.js",
"build": {
@@ -106,3 +106,8 @@
}
}
+
+
+
+
+
diff --git a/package.json.nwjs b/package.json.nwjs
index 70be3294..5402f4b8 100644
--- a/package.json.nwjs
+++ b/package.json.nwjs
@@ -1,7 +1,7 @@
{
"name": "kiwix_js_windows",
"productName": "Kiwix JS Windows",
- "version": "1.9.5-N",
+ "version": "1.9.8-N",
"description": "Kiwix JS Windows for NWJS",
"main": "index.html",
"domain": "kiwix.js.windows",
@@ -88,3 +88,8 @@
}
}
+
+
+
+
+
diff --git a/scripts/Build-NWJS.ps1 b/scripts/Build-NWJS.ps1
index 1f7c6856..a9b4fa5e 100644
--- a/scripts/Build-NWJS.ps1
+++ b/scripts/Build-NWJS.ps1
@@ -11,7 +11,7 @@ if (-Not $only32bit) {
}
$version10 = "0.62.0" # <<< value updated automatically from package.json if launched from Create-DraftRelease
$versionXP = "0.14.7"
-$appBuild = "1.9.5-N" # <<< value updated auotmatically from package.json if launched from Create-DraftRelease
+$appBuild = "1.9.8-N" # <<< value updated auotmatically from package.json if launched from Create-DraftRelease
# $ZIMbase = "wikipedia_en_100"
# Check that the dev has included the correct archive in this branch
$init_params = Get-Content -Raw "$PSScriptRoot\..\www\js\init.js"
@@ -102,3 +102,8 @@ foreach ($build in $builds) {
}
+
+
+
+
+
diff --git a/service-worker.js b/service-worker.js
index c00a44b2..a865560e 100644
--- a/service-worker.js
+++ b/service-worker.js
@@ -29,7 +29,7 @@
* download and install a new copy; we have to hard code this here because it is needed before any other file
* is cached in APP_CACHE
*/
-const appVersion = '1.9.7';
+const appVersion = '1.9.8';
/**
* The name of the Cache API cache in which assets defined in regexpCachedContentTypes will be stored
diff --git a/www/index.html b/www/index.html
index c717c80b..c41357f9 100644
--- a/www/index.html
+++ b/www/index.html
@@ -123,6 +123,7 @@
Changes in version 1.0
+ - Experimental support for reading Zimit ZIM archives
- Nightly builds of main app are now uploaded to a new server (with sftp instead of ssh)
- Deploy PWA image on a k8s cluster
- PWA images are now uploaded to ghcr.io instead of Docker Hub
diff --git a/www/js/app.js b/www/js/app.js
index 35c586ae..c5de2646 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -3507,7 +3507,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
appstate.selectedArchive.resolveRedirect(dirEntry, readArticle);
} else {
//TESTING//
- console.log("Initiating HTML load...");
+ console.log("Initiating HTML load of " + dirEntry.namespace + '/' + dirEntry.url + "...");
//Set startup cookie to guard against boot loop
//Cookie will signal failure until article is fully loaded
@@ -3749,7 +3749,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
}
var cacheKey = appstate.selectedArchive._file.name + '/' + title;
cache.getItemFromCacheOrZIM(appstate.selectedArchive, cacheKey, dirEntry).then(function (content) {
- console.log('SW read binary file for: ' + dirEntry.url);
+ console.log('SW read binary file for: ' + dirEntry.namespace + '/' + dirEntry.url);
if (/\b(css|javascript|video|vtt|webm)\b/i.test(mimetype)) {
var shortTitle = dirEntry.url.replace(/[^/]+\//g, '').substring(0, 18);
uiUtil.pollSpinner('Getting ' + shortTitle + '...');
@@ -3767,6 +3767,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
'imageDisplay': imageDisplayMode,
'content': buffer
};
+ // Prevent running of replay system in Zimit files (it causes blocking exceptions, and we don't use it)
+ if (params.zimitZim && /javascript/i.test(message.mimetype) &&
+ /(?:chunk\.js|\bload\.js|\bsw\.js)(?:[?#]|$)/.test(message.title)) message.content = '';
if (content.buffer) {
// In Edge Legacy, we have to transfer the buffer inside an array, whereas in Chromium, this produces an error
// due to type not being transferrable... (and already detached, which may be to do with storing in IndexedDB in Electron)
@@ -3847,6 +3850,8 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett
// below, it will be further processed to calculate the ZIM URL from the relative path. This regex can cope with legitimate single
// quote marks (') in the URL.
params.regexpTagsWithZimUrl = /(<(?:img|script|link)\b[^>]*?\s)(?:src|href)(\s*=\s*(["']))(?![a-z][a-z0-9+.-]+:)(.+?)(?=\3|\?|#)([\s\S]*?>)/ig;
+ // Similar to above, but tailored for Zimit links
+ params.regexpZimitLinks = /(<(?:a|img|script|link|track)\b[^>]*?\s)(?:src|href)(=(["']))(?!#)(.+?)(?=\3|\?|#)([\s\S]*?>)/ig;
// Regex below tests the html of an article for active content [kiwix-js #466]
// It inspects every