Add zoom command

This commit is contained in:
Oliver Blanthorn 2017-11-15 12:40:26 +00:00
parent a8320c33a7
commit fc9b34d08c
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
2 changed files with 12 additions and 0 deletions

View file

@ -182,6 +182,13 @@ export function clicknext(dir = "next"){
// Stops us from having to hardcode in RPS and reddit, for example.
window.location.href = nextlinks.slice(-1)[0].href
}
//#background
export function zoom(level=0){
level = level > 3 ? level / 100 : level
browser.tabs.setZoom(level)
}
// }}}
// {{{ TABS

5
src/tridactyl.d.ts vendored
View file

@ -20,3 +20,8 @@ interface Window {
declare namespace browser.find {
function find(query, object): any
}
// setZoom has an optional first argument of tabId. Unclear how first argument can be optional.
declare namespace browser.tabs {
function setZoom(number): any
}