Greasy Fork is available in English.

Discussioni » Sviluppo

Modifying external script in Opera, Chrome

§
Pubblicato: 21/08/2019

Modifying external script in Opera, Chrome

I want to ask how to modify external script content before it's executed. In Firefox document.onbeforescriptexecute works reliably (triggered), but not so in other browsers. Can anybody advice me what construct to use that does the job in virtually any browser... Furthermore what is the proper event for @run-at clause?

wOxxOmMod
§
Pubblicato: 21/08/2019
Modificato: 21/08/2019

There's no universal solution for Chrome. Some are listed on stackoverflow.com. Sometimes you can rewrite the html of the current page (example) so that it removes the original external script and replaces it with a modified script like <script>modified code here</script>.

§
Pubblicato: 21/08/2019
Modificato: 21/08/2019

Then is there a universal code to eliminate specific calls in external script? I need to opt out adblock detection popup located in external script, provided the call is known. The script inclusion is made from root document: ...<script src="https://www.site.com/assets/js/app-dist.js"></script> You mean to replace the src attribute by modified content into .textContent?

Pubblica risposta

Accedi per pubblicare una risposta.