Greasemonkey script that removes or blocks select JavaScripts [duplicate]

心不动则不痛 提交于 2019-11-27 08:21:25

问题


I tried unsuccessfully to make a script that deletes another script on a page.

The page loads 2 scripts in <body> that I don't want to execute:

<div id="myindex">
  <div class="wrap">
    <div id="idone"></div>
    <div id="idtwo"></div>
    <script type="text/javascript"></script>
    <script type="text/javascript"></script>
    <script type="text/javascript"></script> //To Remove
    <script type="text/javascript"></script> //To Remove
  </div>
</div>

How do I block just those scripts from running?


回答1:


This works splendidly with the new Greasemonkey @run-at directive!

Here is an example userscript: http://userscripts.org/scripts/show/125936



来源:https://stackoverflow.com/questions/7120626/greasemonkey-script-that-removes-or-blocks-select-javascripts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!