0

This code is from background script and throws error in MS Edge (works fine in Chrome) when function is called:

const zoom = () => {
    console.log('zoom function');

    browser.tabs.getZoom(z =>  {
           //.......
    });
}

zoom function is written on console and then error is shown
SCRIPT5007: Object expected

I have tabs permission in manifest

Wolf War
  • 1,503
  • 1
  • 15
  • 28
  • It's not supported, even tho **tabs** API is [listed under supported](https://learn.microsoft.com/en-us/microsoft-edge/extensions/api-support/supported-apis) – Wolf War Aug 13 '18 at 15:16

1 Answers1

0

Tabs API class itself is supported on Edge. However, tabs.getZoom method is not yet supported. You can view compatibility details on this webpage :: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/getZoom

You can however workaround this using JS in Content Script of your Extension. MS Edge provides this to measure zoom percentage.

screen.deviceXDPI / screen.logicalXDPI

You can view more details in this answer ::: How to detect page zoom level in all modern browsers?

WarPro
  • 350
  • 3
  • 5