Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         My Fancy New Userscript
  3. // @namespace    http://your.homepage/
  4. // @version      0.1
  5. // @description  enter something useful
  6. // @author       You
  7. // @grant        none
  8. // @match        *://*.youtube.com/*
  9. // ==/UserScript==
  10.  
  11. addJS_Node (null, null, GM_main);
  12.  
  13. function addJS_Node (text, s_URL, funcToRun, runOnLoad) {
  14.     var D                                   = document;
  15.     var scriptNode                          = D.createElement ('script');
  16.     if (runOnLoad) {
  17.         scriptNode.addEventListener ("load", runOnLoad, false);
  18.     }
  19.     scriptNode.type                         = "text/javascript";
  20.     if (text)       scriptNode.textContent  = text;
  21.     if (s_URL)      scriptNode.src          = s_URL;
  22.     if (funcToRun)  scriptNode.textContent  = '(' + funcToRun.toString() + ')()';
  23.  
  24.     var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
  25.     targ.appendChild (scriptNode);
  26.    
  27.     open(location, '_self').close();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement