Orion Blog Extra

This very simple script will look for an element with an id of "userscript" and it will insert the contents exactly as is inside a script tag, then append the script to the body. This allows you to enter javascript in a plain text widget, which will get applied to the page. Neat!

  1. // ==UserScript==
  2. // @name Orion Blog Extra
  3. // @namespace http://devtest.co.nz/
  4. // @version 0.1
  5. // @description This very simple script will look for an element with an id of "userscript" and it will insert the contents exactly as is inside a script tag, then append the script to the body. This allows you to enter javascript in a plain text widget, which will get applied to the page. Neat!
  6. // @include http://blogs/*
  7. // @copyright 2014+, You
  8. // ==/UserScript==
  9. var el = document.createElement('script');
  10. el.innerHTML = document.getElementById('userscript').innerHTML;
  11. document.getElementById('userscript').style.display = "none";
  12. document.body.appendChild(el);