Reading the WASM preference

Talk about code development, features, specific bugzilla bugs, enhancements, patches, and other highly technical things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific referenced Bugzilla bugs, mercurial, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Most "bug reports" do not belong in this board and should initially be posted in Community Support or other relevant support boards.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Post Reply
User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Reading the WASM preference

Post by moonbat » 2020-07-18, 13:51

Been trying to figure out where the browser reads javascript.options.wasm but on xref all I can find are multiple test cases apart from the definition of the preference itself. Is there a way to control this functionality?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1252
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reading the WASM preference

Post by Isengrim » 2020-07-18, 14:37

Remember that preference names are just strings, which can be (and often are) formed by concatenating other strings together. So somewhere in code you might have a constant for the pref branch "javascript.options." and further down a variable for "wasm", and then the two can be concatenated and the result passed to a pref-reading method. For example:

http://xref.palemoon.org/moonchild-central/source/platform/dom/workers/RuntimeService.cpp#295
http://xref.palemoon.org/moonchild-central/source/platform/js/xpconnect/src/XPCJSContext.cpp#1403

Not sure if that's what you're looking for as I'm not familiar with how the platform handles wasm, but it might be a stsrt.
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Reading the WASM preference

Post by moonbat » 2020-07-18, 14:41

I searched for WebAssembly as well - and looking only within .js files since I'm looking at how it's handled in Javascript. I want to implement per site WASM permissions for PermissionsPlus the way I've already added per site clipboard API permissions.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1252
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reading the WASM preference

Post by Isengrim » 2020-07-18, 14:56

Oh, so you just need to know how to turn wasm on and off... Wouldn't that amount to a simple read/write like with other prefs? I guess I don't understand what else you are looking for. I would not be surprised if this preference isn't used in the browser's chrome code.
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Reading the WASM preference

Post by moonbat » 2020-07-18, 15:00

WASM applies globally, which means some part of the browser reads the preference and then decides whether to run WASM content on a page or not. I want to do the same thing but for individual sites using separate preferences. Same way as dom.clipboardevents.enabled works at the global level, at the individual site level for PermissionsPlus I search the page and disable any mouse event handlers if the permission for that page is set to deny.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

User avatar
New Tobin Paradigm
Knows the dark side
Knows the dark side
Posts: 7861
Joined: 2012-10-09, 19:37
Location: Space, maybe..

Re: Reading the WASM preference

Post by New Tobin Paradigm » 2020-07-19, 07:30

That is not possible nor will it be made possible. The sheer ridiculousness of requesting an endless number of features be tied to every fully qualified domain on the planet is monstrous. You need to stop.
Image
- Mars will never be free until the sands run red with Earther blood! -

Image

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Reading the WASM preference

Post by moonbat » 2020-07-19, 08:04

New Tobin Paradigm wrote:
2020-07-19, 07:30
The sheer ridiculousness of requesting an endless number of features be tied to every fully qualified domain on the planet is monstrous. You need to stop.
Eh, it's for an extension that lets you set some preferences per site. Already supports per site setting for dom.event.clipboardevents.enabled, so wanted to do the same for a few other things.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Reading the WASM preference

Post by moonbat » 2020-08-04, 04:30

..so is there a way to do this?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 27871
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: Reading the WASM preference

Post by Moonchild » 2020-08-04, 06:58

javascript options can't be set per-site.
Flipping them willy-nilly even if you "fake" it can also cause severe run-time issues, so please don't.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

User avatar
moonbat
Moon Magic practitioner
Moon Magic practitioner
Posts: 2174
Joined: 2015-12-09, 15:45

Re: Reading the WASM preference

Post by moonbat » 2020-08-04, 07:03

Ok. For now it just provides per site DOM event overrides so you can block it for a few sites while keeping it globally enabled.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Linux Mint 20 Xfce x64 on HP i5 laptop with 12 GB RAM, always latest versions of PM & Basilisk unless specified.

Post Reply