From 5afad35c4e2d37a634ac42da3fa3a0fd8837384e Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 11 Jan 2020 15:34:12 -0500 Subject: Fix _onApiGetZoom when chrome.tabs.getZoom is not available --- ext/bg/js/backend.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ext/bg') 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) { -- cgit v1.2.3