Add support for WebView 70+

This commit is contained in:
OleSTEEP 2024-03-04 00:40:22 +03:00
parent 4de74a3b6c
commit e0bb234102
12 changed files with 30944 additions and 27280 deletions

View file

@ -2,26 +2,6 @@
window._MEMO_PATHS = {}
/**
* String.prototype.replaceAll() polyfill
* https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/
* @author Chris Ferdinandi
* @license MIT
*/
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function(str, newStr){
// If a regex pattern
if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
return this.replace(str, newStr);
}
// If a string
return this.replace(new RegExp(str, 'g'), newStr);
};
}
function replaceSpecialSymbols(s) {
const memoized = _MEMO_PATHS[s];
if (memoized != undefined) {
@ -439,7 +419,7 @@ require.libs.fs = {
}
throw e;
}
return xhr.status === 200 || xhr.status === 0;
return xhr.status === 200 || xhr.responseText !== "";
},
unlinkSync: function () {