8

There is a userContent.css available in Firefox to customize / override a website's CSS to a new one, but what about the JavaScript?

How can I override a particular website's JavaScript or some part of the JavaScript of a website to a local machine's JavaScript in Firefox?

Any greasemonkey tips or something else native tips without any addons? or are there any plugins available for the same?

Jason Aller
  • 2,360
Bhavesh G
  • 309

2 Answers2

6

Yes, tested with Firefox 115.

Open the debugger, select the file you'd like to override, right click and select "Add script override".

Screenshot of the "Add script override" button in the dev tools

Select a destination for the file, and click save. You can now edit the file (for example, to add console.log('override!!') at the top) and the new file will be used when you reload:

showing 'override!!' in console

There will be a little purple dot in the debugger indicating its overridden state:

purple dot indicating override

flaviut
  • 289
0

It may be possible to override the original JavaScript functionality of a website in some cases. I know of examples using bookmarklets:

mvark
  • 2,430