disable-webassembly icon indicating copy to clipboard operation
disable-webassembly copied to clipboard

I have disabled Web Assembly in my Chrome, but nothing changed

Open detro opened this issue 6 years ago • 6 comments

Chrome Version 65.0.3325.181 (Official Build) (64-bit)

screen shot 2018-03-26 at 16 11 05

I then tried different WASM application, especially coinhive.com and other ads-crypto-miners: they all still work just fine.

I'm trying to protect myself without the need of using AdBlock for it. But Chrome is making it really hard.

detro avatar Mar 26 '18 15:03 detro

This flag does not disable WebAssembly. You need to run Chrome with --js-flags=--noexpose_wasm command line flag. Look for tutorials on altering Chrome shortcut for your OS.

In Windows you might also want to modify the chrome's command line in registry: HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command HKEY_CLASSES_ROOT\http\shell\open\command HKEY_CLASSES_ROOT\https\shell\open\command And then uncheck the write permission on these keys so that the changes persist on next auto-update of Chrome.

Note, many/all miners run a fallback code in pure js.

tophf avatar Mar 28 '18 02:03 tophf

This flag does not disable WebAssembly. You need to run Chrome with --js-flags=--noexpose_wasm command line flag.

acording to Chromium's code #1, #2, both enable-asm-wasm & enable-wasm were not disabled but migrated to feature flag, this means that to disable wasm in Chrome based browsers one should pass --disable-features=WebAssembly,AsmJsToWebAssembly to the chrome execute as a command-line argument. I guess using --js-flags="..." will work too but I haven't tried it..

eladkarako avatar Jun 02 '18 21:06 eladkarako

I tried --disable-features=WebAssembly,AsmJsToWebAssembly but it didn't work on Chrome 66 (macOS). --js-flags=--noexpose_wasm does work consistently for me though.

On macOS, we need to start Chrome using the following command:

open /Applications/Google\ Chrome.app --args --js-flags=--noexpose_wasm

It should be noted that the Brave browser (Laptop edition) is build on Chromium and Webassembly can be disabled by the same method, using --js-flags=--noexpose_wasm

stevespringett avatar Jun 03 '18 04:06 stevespringett

@tophf thanks for the updates on chrome, specifically the command-line arg and the registry advise. I've added the content to the projects readme and acknowledged your contribution.

stevespringett avatar Jun 03 '18 04:06 stevespringett

I will give it another go, but I checked all of the above and even got a bug about this o the Mac OS X version of Chrome open and assigned: https://bugs.chromium.org/p/chromium/issues/detail?id=825845

If this is now working as expected, it means in the meantime they fixed it.

detro avatar Jun 03 '18 22:06 detro

@stevespringett its good to know, I'm having them both anyway --disable-features="WebAssembly,AsmJsToWebAssembly,WebAssemblyStreaming" --js-flags="--noexpose-wasm".

..along with a chrome extension I've made that sets self.WebAssembly = undefined; before the pages loads-up, effectively erasing the API from existence from the page and every iframe in-it (you can do the same with APIs such as WebSocket, IndexedDB, History, etc...)

those arguments are already being added to chrome://version/ when switching the suitable flags in Chromium's chrome://flags/#enable-asm-webassembly, so it might take a while until it will effect Google Chrome.

eladkarako avatar Jun 04 '18 20:06 eladkarako

Ah, very good background information @eladkarako . Thank you. If you find that the flags make it into Google Chrome before I do, please ping this ticket and update it if you could.

stevespringett avatar Jun 06 '18 04:06 stevespringett

Hello. Version 91.0.4472.164 (Official Build) Arch Linux (64-bit) I managed to turn off WebAssembly by disabling the following parameters in chrome://flags:

  • #enable-webassembly-baseline
  • #enable-webassembly-lazy-compilation
  • #enable-webassembly-simd
  • #enable-webassembly-threads
  • #enable-webassembly-tiering .

It seems that it is off now after launching this script from StackOverflow. Option --js-flags=--noexpose_wasm didn't work for some reason.

basketdou avatar Jul 22 '21 20:07 basketdou