Taw_

CollabEdit RunJS button

Sep 30th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         CollabEdit RunJS
  3. // @namespace    Butts
  4. // @version      0.1
  5. // @description  Adds a RunJS button to the editor page on collabedit.com
  6. // @author       Taw
  7. // @match        http*://collabedit.com/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.     if (document.querySelector("#sidebar_div")) {
  14.         var div = document.querySelector("#sidebar_div");
  15.         div.insertAdjacentHTML('beforebegin','<button id="runbtn" onclick=\'var i = document.querySelector("#frame_the_input");var d = i.contentDocument || i.contentWindow.document; if (d){t = d.getElementById("textarea"); eval(t.value)}\'>Run JS in Browser Console</button>');
  16.     }
  17. })();
Advertisement
Add Comment
Please, Sign In to add comment