Created
December 26, 2015 03:20
-
-
Save addie/42a55566420633343479 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name HackerRank Copy/Paste | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Allow copy/paste on HackerRank | |
// @author Rinoc Johnson | |
// @include https://www.hackerrank.com/tests/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; | |
var docEvents = $(document).data('events'), | |
targetEvents = [ | |
'contextmenu', | |
'cut', | |
'copy', | |
'paste' | |
]; | |
Object.observe(docEvents, function (changes) { | |
changes.forEach(function (change) { | |
if (targetEvents.indexOf(change.name) != - 1 && change.type == 'add') { | |
$(document).off(change.name); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment