Skip to content

Instantly share code, notes, and snippets.

@xinhaoyuan
Created September 16, 2016 19:43
Show Gist options
  • Save xinhaoyuan/4586ef0b2478f2bcf55a3df1a034bdda to your computer and use it in GitHub Desktop.
Save xinhaoyuan/4586ef0b2478f2bcf55a3df1a034bdda to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name RefreshPdf
// @namespace xinhaoyuan@gmail.com
// @description Refresh pdf in current view
// @include *.pdf*
// @version 1
// @grant none
// ==/UserScript==
(function () {
document.addEventListener('keydown', function (e) {
// pressed ctrl-r
if (e.keyCode == 82 && e.ctrlKey) {
var curViewLink = document.getElementById('viewBookmark');
window.location = curViewLink.href;
window.location.reload();
}
}, false);
}) ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment