Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save CanYouJustWorkPlease/b2404126866f5ab82b0d25e185d3e29f to your computer and use it in GitHub Desktop.

Select an option

Save CanYouJustWorkPlease/b2404126866f5ab82b0d25e185d3e29f to your computer and use it in GitHub Desktop.
Use Numped + to skip forward, Numepad - to rewind and Numpad Enter to play/pause
// ==UserScript==
// @name Control buttons for naturalreaders.com
// @author CanYouJustWorkPlease
// @version 0.1
// @description try to take over the world!
// @match *://*.naturalreaders.com/*
// @grant none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
// Use Numped + to skip forward, Numepad - to rewind and Numpad Enter to play/pause
var $ = window.jQuery;
$.noConflict();
var script = document.createElement("script");
script.setAttribute("type", "application/javascript");
script.textContent = "(" + function(){
// Play on Numpad -
$(document).keypress(function(e) {
if(e.code == "NumpadSubtract") {
$('#playBtn').trigger("click");
}
});
// Forward on Numpad +
$(document).keypress(function(e) {
if(e.code == "NumpadAdd") {
$('#forwardBtn').trigger("click");
}
});
// Rewind on Numpad Enter
$(document).keypress(function(e) {
if(e.code == "NumpadEnter") {
$('#rewindBtn').trigger("click");
e.preventDefault();
}
});
} + ")()";
document.body.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment