Greasy Fork is available in English.

議論 » 開発

Modifying external script in Opera, Chrome

§
投稿日: 2019/08/21

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
§
投稿日: 2019/08/21
編集日: 2019/08/21

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>.

§
投稿日: 2019/08/21
編集日: 2019/08/21

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?

返信を投稿

返信を投稿するにはログインしてください。