Load external JS from bookmarklet?

前端 未结 4 1757
不知归路
不知归路 2020-12-02 08:23

How can I load an external JavaScript file using a bookmarklet? This would overcome the URL length limitations of IE and generally keep things cleaner.

4条回答
  •  甜味超标
    2020-12-02 08:58

    Firefox and perhaps others support multiline bookmarklets, no need for one liner. When you paste in the code it just replaces newlines with spaces.

    javascript:
    var q = document.createElement('script');
    q.src = 'http://svnpenn.github.io/bm/yt.js';
    document.body.appendChild(q);
    void 0;
    

    Example

提交回复
热议问题