aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/background/index.js3
-rw-r--r--src/background/key-queue.js2
-rw-r--r--src/background/tabs.js9
-rw-r--r--src/shared/actions.js2
4 files changed, 15 insertions, 1 deletions
diff --git a/src/background/index.js b/src/background/index.js
index 62e4a7b..f1a7217 100644
--- a/src/background/index.js
+++ b/src/background/index.js
@@ -39,6 +39,9 @@ const doBackgroundAction = (sender, action) => {
case actions.TABS_NEXT:
tabs.selectNextTab(sender.tab.index, actions[1] || 1);
break;
+ case actions.TABS_RELOAD:
+ tabs.reload(sender.tab, actions[1] || false);
+ break;
case actions.ZOOM_IN:
zooms.zoomIn();
break;
diff --git a/src/background/key-queue.js b/src/background/key-queue.js
index d3f4621..f5f9a53 100644
--- a/src/background/key-queue.js
+++ b/src/background/key-queue.js
@@ -13,6 +13,8 @@ const DEFAULT_KEYMAP = [
{ keys: [{ code: KeyboardEvent.DOM_VK_U }], action: [ actions.TABS_REOPEN]},
{ keys: [{ code: KeyboardEvent.DOM_VK_H }], action: [ actions.TABS_PREV, 1 ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_L }], action: [ actions.TABS_NEXT, 1 ]},
+ { keys: [{ code: KeyboardEvent.DOM_VK_R }], action: [ actions.TABS_RELOAD, false ]},
+ { keys: [{ code: KeyboardEvent.DOM_VK_R, shift: true }], action: [ actions.TABS_RELOAD, true ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_Z }, { code: KeyboardEvent.DOM_VK_I }], action: [ actions.ZOOM_IN ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_Z }, { code: KeyboardEvent.DOM_VK_O }], action: [ actions.ZOOM_OUT ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_Z }, { code: KeyboardEvent.DOM_VK_Z }], action: [ actions.ZOOM_NEUTRAL]},
diff --git a/src/background/tabs.js b/src/background/tabs.js
index 899284d..56f86eb 100644
--- a/src/background/tabs.js
+++ b/src/background/tabs.js
@@ -40,4 +40,11 @@ const selectNextTab = (current, count) => {
});
};
-export { closeTab, reopenTab, selectNextTab, selectPrevTab };
+const reload = (current, cache) => {
+ browser.tabs.reload(
+ current.id,
+ { bypassCache: cache }
+ );
+};
+
+export { closeTab, reopenTab, selectNextTab, selectPrevTab, reload };
diff --git a/src/shared/actions.js b/src/shared/actions.js
index 656b801..f0a224c 100644
--- a/src/shared/actions.js
+++ b/src/shared/actions.js
@@ -4,6 +4,7 @@ export const TABS_CLOSE = 'tabs.close';
export const TABS_REOPEN = 'tabs.reopen';
export const TABS_PREV = 'tabs.prev';
export const TABS_NEXT = 'tabs.next';
+export const TABS_RELOAD = 'tabs.reload';
export const SCROLL_UP = 'scroll.up';
export const SCROLL_DOWN = 'scroll.down';
export const SCROLL_TOP = 'scroll.top';
@@ -20,6 +21,7 @@ const BACKGROUND_ACTION_SET = new Set([
TABS_REOPEN,
TABS_PREV,
TABS_NEXT,
+ TABS_RELOAD,
ZOOM_IN,
ZOOM_OUT,
ZOOM_NEUTRAL