How to modify a json value inside an embedded script?
Script tags run just once when they are first added/parsed so changing their tags afterwards does nothing, it won't even matter if the script elements are removed. You'll need to change the code of the page before it comes into the tab. There are two methods: 1) Firefox extensions that use browser.webRequest.filterResponseData
and 2) programs like Fiddler or Charles proxy that can be configured to modify the HTTP response.
How to modify a json value inside an embedded script?
Hi, there's a site with an embedded JS script featuring a configuration JSON that is then supplied to an external JS script, I'd like to make a script to live update the configuration JSON before it is supplied to the external JS script.
Basically, the HTML page looks like this:
The whole idea is to switch 'btnTest.enabled' from 'false' to 'true'.
I started like this:
But nothing seems to work at all, even in this partial state. Any advice?