Skip to content

Instantly share code, notes, and snippets.

@robertcdawson
Created October 2, 2014 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertcdawson/e9e49e30027e66c19b23 to your computer and use it in GitHub Desktop.
Save robertcdawson/e9e49e30027e66c19b23 to your computer and use it in GitHub Desktop.
Tampermonkey script to close Amazon preview window with Esc key
// ==UserScript==
// @name Close Amazon Preview with Esc Key
// @namespace http://www.therobbiedshow.com/
// @version 0.1
// @description Close Amazon preview window when clicking the Esc key!
// @match http://www.amazon.com
// @include http://*/*
// @copyright 2014+, Robert Dawson
// @require http://code.jquery.com/jquery-latest.min.js
// ==/UserScript==
jQuery(document).ready(function(){
jQuery(document).keyup(function(e) {
if (e.keyCode == 27) { jQuery('#sitbReaderCloseLink').click(); }
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment