Reading the WASM preference

Talk about code development, features, specific bugs, enhancements, patches, and similar 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 bugs, git, the repositories, 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. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

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.
User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Reading the WASM preference

Unread 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."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Reading the WASM preference

Unread 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.
a.k.a. Ascrod
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
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Reading the WASM preference

Unread 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."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Reading the WASM preference

Unread 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.
a.k.a. Ascrod
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
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Reading the WASM preference

Unread 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."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

New Tobin Paradigm

Re: Reading the WASM preference

Unread 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.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Reading the WASM preference

Unread 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."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Reading the WASM preference

Unread 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."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35483
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Reading the WASM preference

Unread 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.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Reading the WASM preference

Unread 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."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

Locked