Skip to content

Instantly share code, notes, and snippets.

@midlan
Last active February 16, 2024 13:32
Show Gist options
  • Save midlan/5b9e786266bdca68b45ae88da92c7669 to your computer and use it in GitHub Desktop.
Save midlan/5b9e786266bdca68b45ae88da92c7669 to your computer and use it in GitHub Desktop.

Revisions

  1. midlan revised this gist May 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bookmarklet_inject_script_to_page.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    javascript: (function() {

    var url = prompt('URL of script to inject:');
    var url = prompt('URL of script to inject:', 'https://code.jquery.com/jquery-3.4.1.min.js');

    if (url) {

  2. midlan renamed this gist Mar 11, 2019. 1 changed file with 0 additions and 0 deletions.
  3. midlan created this gist Feb 7, 2019.
    16 changes: 16 additions & 0 deletions inject_script_to_page.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    javascript: (function() {

    var url = prompt('URL of script to inject:');

    if (url) {

    console.log('Script inject request URL:', url);

    var script = document.createElement('script');
    script.src = url;
    document.getElementsByTagName('head')[0].appendChild(script);

    console.log('Injected script: ', script);
    }

    })();