Block specific script from loading on a specific site

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
PseudoDistant
Moonbather
Moonbather
Posts: 73
Joined: 2024-02-06, 20:19

Block specific script from loading on a specific site

Unread post by PseudoDistant » 2024-03-05, 00:41

I figured out DOM manipulation! :D
Now, instead of redirecting the user to a Flash file, Flashify will re-embed the Flash document into the page itself!
Image
Unfortunately, I have issues with some sites reloading the page when I do this.
Consistently, when this happens, the log spits out an error thrown by Ruffle itself. Ruffle seems to believe that it's crashing, and regenerates the parts of the document that I edit.
Consistently, when this happens, the Ruffle instance is self-hosted.
I want to block

Code: Select all

https://dinky-site.net/js/ruffle.js
from executing, without blocking the rest of the site's JS.
I want to also not rely on another extension (I'm well aware that uBlock Origin can do this with a filter, that's how I'm testing for now).
How would I block this one specific script via an extension?
Eat your school.
Eat your drugs.
Eat your teeth.

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

Re: Block specific script from loading on a specific site

Unread post by moonbat » 2024-03-05, 07:06

Take a look at this page, specifically the Content Policy section.
"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
PseudoDistant
Moonbather
Moonbather
Posts: 73
Joined: 2024-02-06, 20:19

Re: Block specific script from loading on a specific site

Unread post by PseudoDistant » 2024-03-08, 16:23

moonbat wrote:
2024-03-05, 07:06
Take a look at this page, specifically the Content Policy section.
Do I need to register an XPCOM component for it, or is there a listener that I could add to gBrowser or elsewhere?
Eat your school.
Eat your drugs.
Eat your teeth.

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

Re: Block specific script from loading on a specific site

Unread post by moonbat » 2024-03-08, 16:33

The other two options on that page might serve you better; personally I prefer HTTP observers since they're tab independent and will work for any HTTP request, not just clicks from a webpage. Take notes of the caveats of keeping the observer code as slim as possible though.
"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