Skip to content

Instantly share code, notes, and snippets.

@addie
Created December 26, 2015 03:20
Show Gist options
  • Save addie/42a55566420633343479 to your computer and use it in GitHub Desktop.
Save addie/42a55566420633343479 to your computer and use it in GitHub Desktop.
// ==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