aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-11 15:34:12 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-22 20:38:21 -0500
commit5afad35c4e2d37a634ac42da3fa3a0fd8837384e (patch)
treeec819135bd8e0eecbc34e12e6befdd07568f1a16
parent74d9b0e857bc8fc086a6ffaf4178c2372779ecd3 (diff)
Fix _onApiGetZoom when chrome.tabs.getZoom is not available
-rw-r--r--ext/bg/js/backend.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 4e6c59df..f9322959 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -542,6 +542,15 @@ class Backend {
return new Promise((resolve, reject) => {
const tabId = sender.tab.id;
+ if (!(
+ chrome.tabs !== null &&
+ typeof chrome.tabs === 'object' &&
+ typeof chrome.tabs.getZoom === 'function'
+ )) {
+ // Not supported
+ resolve({zoomFactor: 1.0});
+ return;
+ }
chrome.tabs.getZoom(tabId, (zoomFactor) => {
const e = chrome.runtime.lastError;
if (e) {