How can I dynamically download and run a javascript script from a javascript console?

前端 未结 3 881
死守一世寂寞
死守一世寂寞 2021-02-14 06:26

Is there a one-liner I could execute in a javascript console to download and execute a javascript script from a remote source?

I was looking to see if there was a nic

3条回答
  •  不思量自难忘°
    2021-02-14 07:02

    1. Go to the remote source (e.g.: https://ajax.googleapis.com/ajax/libs/d3js/5.7.0/d3.min.js)

    2. Select all the js source (ctrl + a) and copy to the clipboard (ctrl + c)

    3. Go to the target website where you want to inject the js

    4. Open the console, paste the copied source and hit enter

    All the functions of the library are available to you on the target website's console now.

提交回复
热议问题