User:Uraxys/common.js
From Idle Clans wiki
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// Testing // mw.loader.load('//wiki.idleclans.com/index.php?title=User:Uraxys/scripts/test.js&action=raw&ctype=text/javascript'); // local IDE //mw.loader.load('http://mediawiki.localhost/src/mediawiki.js'); var wasm_base64; var wasm_buffer; var wasm; var wasm_instance; function hw() { wasm_base64 = "AGFzbQEAAAABBwFgAnx8AXwDAgEABwoBBm15X2FkZAAACgkBBwAgACABoAs="; wasm_buffer = Uint8Array.from(atob(wasm_base64), function (c) { return c.charCodeAt(0); }).buffer; WebAssembly.compile(wasm_buffer).then(function(x) { wasm = x; wasm_instance = new WebAssembly.Instance(wasm); var x = wasm_instance.exports.my_add(2,2); console.log("2+2 = ",x); }); } hw();