From c21d6c9700d4e95aad516171324b7ffd1ddb0e78 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 30 Dec 2016 00:58:28 -0500 Subject: [PATCH] Allow Cmd-R/Ctrl-R to reload page in basic viewer --- chrome/content/zotero/standalone/basicViewer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/standalone/basicViewer.js b/chrome/content/zotero/standalone/basicViewer.js index 76fb271d21..f1ab4f1df0 100644 --- a/chrome/content/zotero/standalone/basicViewer.js +++ b/chrome/content/zotero/standalone/basicViewer.js @@ -45,4 +45,13 @@ window.addEventListener("load", function() { window.setTimeout(function() { document.getElementById("my-browser").style.overflow = "auto"; }, 0); -}, false); \ No newline at end of file +}, false); + +window.addEventListener("keypress", function (event) { + // Cmd-R/Ctrl-R (with or without Shift) to reload + if (((Zotero.isMac && event.metaKey && !event.ctrlKey) + || (!Zotero.isMac && event.ctrlKey)) + && !event.altKey && event.which == 114) { + browser.reloadWithFlags(browser.webNavigation.LOAD_FLAGS_BYPASS_CACHE); + } +});