mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-08-03 19:38:36 -04:00
Remove incompatible Wikimedia webpHandler
This commit is contained in:
parent
e598f6951b
commit
faa729cd62
@ -6094,9 +6094,12 @@ function displayArticleContentInContainer (dirEntry, htmlArticle) {
|
||||
if (!/<section\b[^>]*data-mw-section-id=["'][1-9]/i.test(htmlArticle)) break;
|
||||
}
|
||||
}
|
||||
} else if (appstate.wikimediaZimLoaded && params.manipulateImages) {
|
||||
// Remove incompatible webP handler that breaks on some Edge Legacy
|
||||
htmlArticle = htmlArticle.replace(/<script\b[^<]+src=["'][^"']*(webp(?:Handler|Hero))[^"']*\.js\b[^<]+<\/script>/gi, '');
|
||||
} else if (appstate.wikimediaZimLoaded && params.openAllSections) {
|
||||
// Remove incompatible webP handler that breaks on some Edge Legacy and conflicts with own webP handler
|
||||
// @TODO It appears webpHandler is loaded by script.js, so this line and equivalent in block above may be redundant. Check for latest ZIMs.
|
||||
// Maybe older ZIMs loaded them direct?
|
||||
htmlArticle = htmlArticle.replace(/<script\b[^>]+src=["'][^"']*(webp(?:Handler|Hero))[^"']*\.js\b[^<]+<\/script>/gi, '');
|
||||
htmlArticle = htmlArticle.replace(/<script\b[^>]+-\/(j\/js_modules\/)?script\.js"[^<]*<\/script>/i, '');
|
||||
}
|
||||
|
||||
// Gutenberg ZIMs try to initialize before all assets are fully loaded. Affect UWP app.
|
||||
|
Loading…
x
Reference in New Issue
Block a user