aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
Diffstat (limited to 'src/background')
-rw-r--r--src/background/index.js3
-rw-r--r--src/background/key-queue.js1
-rw-r--r--src/background/zooms.js10
3 files changed, 11 insertions, 3 deletions
diff --git a/src/background/index.js b/src/background/index.js
index cfd5e77..62e4a7b 100644
--- a/src/background/index.js
+++ b/src/background/index.js
@@ -45,6 +45,9 @@ const doBackgroundAction = (sender, action) => {
case actions.ZOOM_OUT:
zooms.zoomOut();
break;
+ case actions.ZOOM_NEUTRAL:
+ zooms.neutral();
+ break;
}
}
diff --git a/src/background/key-queue.js b/src/background/key-queue.js
index 6319431..d3f4621 100644
--- a/src/background/key-queue.js
+++ b/src/background/key-queue.js
@@ -15,6 +15,7 @@ const DEFAULT_KEYMAP = [
{ keys: [{ code: KeyboardEvent.DOM_VK_L }], action: [ actions.TABS_NEXT, 1 ]},
{ 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]},
{ keys: [{ code: KeyboardEvent.DOM_VK_F }], action: [ actions.FOLLOW_START, false ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_F, shift: true }], action: [ actions.FOLLOW_START, true ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_H, shift: true }], action: [ actions.HISTORY_PREV ]},
diff --git a/src/background/zooms.js b/src/background/zooms.js
index def2878..bb65030 100644
--- a/src/background/zooms.js
+++ b/src/background/zooms.js
@@ -18,7 +18,7 @@ const zoomIn = (tabId = undefined) => {
}
}
});
-}
+};
const zoomOut = (tabId = undefined) => {
browser.tabs.getZoom(tabId).then((factor) => {
@@ -29,6 +29,10 @@ const zoomOut = (tabId = undefined) => {
}
}
});
-}
+};
-export { zoomIn, zoomOut };
+const neutral = (tabId = undefined) => {
+ browser.tabs.setZoom(tabId, 1);
+};
+
+export { zoomIn, zoomOut, neutral };