Stop execution of Javascript function (client side) or tweak it

前端 未结 5 2068
别跟我提以往
别跟我提以往 2020-11-22 08:48

I want to stop the execution of one single line from a site, so that the whole page is read by the browser except that single line. Or the browser may simply skip the execut

5条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 09:27

    You can use what is called a bookmarklet.

    Build the js file you want to run on the other site: your.js

    Make an HTML page with the following code:

    
    
      
        Drag'n Drop this to your bookmarks
      
    
    
    

    Replace /url/to/your.js with the path of your js file.

    Load that small page in your browser and drag'n drop the link to your bookmark bar.

    Go to the web site you want to hack, and click the bookmark you just created.
    This will load your.js in the page and run the code.

    Note: the ?'+(Math.random()) part is to avoid your js being cached, this is not mandatory but it is helpful when you develop your.js

提交回复
热议问题