handsfree-for-web-modules
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "handsfree-for-web-modules", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Voice commands modules for Handsfree for web", | ||
@@ -5,0 +5,0 @@ "source": "src/index.js", |
import { executeBackgroundAction } from './helpers/background'; | ||
const zoomFactor = 0.1; | ||
export function zoomInTab() { | ||
const { tabs } = window.chrome; | ||
tabs.query({ active: true, lastFocusedWindow: true }, (tab) => { | ||
const tabId = tab[0].id; | ||
tabs.getZoom(tabId, (zoom) => { | ||
tabs.setZoom(tabId, zoom + zoomFactor); | ||
}); | ||
}); | ||
} | ||
export function zoomOutTab() { | ||
const { tabs } = window.chrome; | ||
tabs.query({ | ||
active: true, | ||
lastFocusedWindow: true, | ||
}, (tab) => { | ||
const tabId = tab[0].id; | ||
tabs.getZoom(tabId, (zoom) => { | ||
tabs.setZoom(tabId, zoom - zoomFactor); | ||
}); | ||
}); | ||
} | ||
export function restoreZoom() { | ||
const { tabs } = window.chrome; | ||
tabs.query({ | ||
active: true, | ||
lastFocusedWindow: true, | ||
}, (tab) => { | ||
const tabId = tab[0].id; | ||
tabs.setZoom(tabId, 0); | ||
}); | ||
} | ||
function zoomIn() { | ||
@@ -41,0 +4,0 @@ executeBackgroundAction({ |
186368
1883