I have a page that loads javascript using a <script src="some/script.js">
tag. I wanted to replace a string in the external javascript file. And I found no way to do this in chrome. local overrides could work, but I don't want to keep the devtools open to make this work.
I tried the following
window.onbeforescriptexecute = function(e)=>(modifier code)
or
window.addEventListener("beforescriptexecute", (e)=>{modifier code});
But they don't work at all. I also tried this snippet here, still with no luck.
How can I make this work?