Skip to content

Instantly share code, notes, and snippets.

@johnelliott
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnelliott/690905bb909347a56941 to your computer and use it in GitHub Desktop.
Save johnelliott/690905bb909347a56941 to your computer and use it in GitHub Desktop.
Fix code school kill line and delete
// ==UserScript==
// @name monkeybusiness-codeschool
// @namespace https://github.com/johnelliott/monkeybusiness
// @include http://*.codeschool.com/*
// ==/UserScript==
//document.querySelector("div.CodeMirror textarea").focus();
// make script tag
var ninjaScript = document.createElement("script");
ninjaScript.text = 'var n = getEventListeners(document.body).keyup;\n' +
'console.log("do we have an n?", n);\n' +
'document.body.removeEventListener("keyup", n[0].listener);\n' +
'// put listener back and see if it\'s \n' +
'\n' +
'function guardedKeyupListener(e) {\n' +
' if ((e.keyCode === 75 || e.keyCode === 74) && e.ctrlKey) {\n' +
' console.log("return?");\n' +
' return;\n' +
' }\n' +
' console.log("listener call");\n' +
' n[0].listener.call(this, e);\n' +
'}\n';
document.body.appendChild(ninjaScript);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment