Add search params to x2t.wasm to prevent caching

https://github.com/cryptpad/cryptpad/issues/1278
This commit is contained in:
Wolfgang Ginolas 2023-10-09 09:28:15 +02:00
parent 16115de950
commit c7f9474325

View file

@ -31,6 +31,20 @@ if (!Module) /** @suppress{checkTypes}*/Module = typeof Module !== 'undefined' ?
// refer to Module (if they choose; they can also define Module)
Module.noInitialRun = true;
Module.noExitRuntime = true;
(function() {
let suffix;
if (typeof document != 'undefined') {
const myScript = document.currentScript;
const mySrc = myScript.getAttribute('src');
suffix = new URL(mySrc).search;
} else {
suffix = '';
}
Module.locateFile = function(path, prefix) {
return prefix + path + suffix;
};
})();
// Sometimes an existing Module object exists with properties