diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-28 10:51:52 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-28 14:20:29 +0900 |
commit | ccdb0a2428bbdc56e8288442f844a4bb3b8f9a11 (patch) | |
tree | c1d653b3792917473bace600d12a071b35f6168c /src/background/shared/zooms.js | |
parent | 66c23423f931bb66c59cd29cf9279a5de5d56535 (diff) |
Clean old codes
Diffstat (limited to 'src/background/shared/zooms.js')
-rw-r--r-- | src/background/shared/zooms.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/background/shared/zooms.js b/src/background/shared/zooms.js deleted file mode 100644 index 17b28fa..0000000 --- a/src/background/shared/zooms.js +++ /dev/null @@ -1,32 +0,0 @@ -// For chromium -// const ZOOM_SETTINGS = [ -// 0.25, 0.33, 0.50, 0.66, 0.75, 0.80, 0.90, 1.00, -// 1.10, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00, 4.00, 5.00 -// ]; - -const ZOOM_SETTINGS = [ - 0.33, 0.50, 0.66, 0.75, 0.80, 0.90, 1.00, - 1.10, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00 -]; - -const zoomIn = async(tabId = undefined) => { - let current = await browser.tabs.getZoom(tabId); - let factor = ZOOM_SETTINGS.find(f => f > current); - if (factor) { - return browser.tabs.setZoom(tabId, factor); - } -}; - -const zoomOut = async(tabId = undefined) => { - let current = await browser.tabs.getZoom(tabId); - let factor = [].concat(ZOOM_SETTINGS).reverse().find(f => f < current); - if (factor) { - return browser.tabs.setZoom(tabId, factor); - } -}; - -const neutral = (tabId = undefined) => { - return browser.tabs.setZoom(tabId, 1); -}; - -export { zoomIn, zoomOut, neutral }; |