Fix _onApiGetZoom when chrome.tabs.getZoom is not available
This commit is contained in:
parent
74d9b0e857
commit
5afad35c4e
@ -542,6 +542,15 @@ class Backend {
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const tabId = sender.tab.id;
|
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) => {
|
chrome.tabs.getZoom(tabId, (zoomFactor) => {
|
||||||
const e = chrome.runtime.lastError;
|
const e = chrome.runtime.lastError;
|
||||||
if (e) {
|
if (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user