Open Bug 1319387 Opened 3 years ago Updated Last year

Support changing zoom scopes per tab


(WebExtensions :: Frontend, enhancement, P5)

49 Branch


(Not tracked)


(Reporter: dw-dev, Unassigned)


(Depends on 1 open bug, Blocks 1 open bug)


(Keywords: parity-chrome, Whiteboard: [design-decision-approved][triaged])

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID: 20160922113459

Steps to reproduce:

I have recently developed a WebExtensions add-on, Zoom Page WE, based on my original XUL/XPCOM Zoom Page add-on.

Zoom Page WE has now been released on both Firefox and Chrome.

I have noticed that the WebExtensions implementation of chrome.tabs.setZoomSettings() is not fully compatible with the Chrome implementation.

With WebExtensions, it is not possible to change the scope of zoom (from Per-Site to Per-Tab, or vice versa) by setting the tabs.ZoomSettings.scope property.

This restriction means that Zoom Page WE has to prompt the user to change the browser.zoom.siteSpecific preference manually, which severely compromises the user experience and will probably confuse some users.

A simple fix would be to add the following code into the setZoomSettings() function in "ext-tabs.js":

    if (settings.scope == "per-origin" || settings.scope == "per-tab") {

        currentSettings.scope = settings.scope;

        gPrefService.setBoolPref("browser.zoom.siteSpecific", settings.scope != "per-tab");
        if (settings.scope != "per-tab") FullZoom._applyZoomToPref(tab.linkedBrowser);

Actual results:

It is not possible to change the scope of zoom (from Per-Site to Per-Tab, or vice versa) by setting the tabs.ZoomSettings.scope property.

Expected results:

It should be possible to change the scope of zoom (from Per-Site to Per-Tab, or vice versa) by setting the tabs.ZoomSettings.scope property.
Component: Untriaged → WebExtensions: Frontend
Ever confirmed: true
Product: Firefox → Toolkit
Summary: WebExtensions: chrome.tabs.setZoomSettings() does not support changing scope of zoom → Support changing zoom scopes per tab
Priority: -- → P3
Whiteboard: [advisory-group]
Please could you give me some feedback on the proposed code changes to "ext-tabs.js" in the Description section above.

Based on my experience of developing my Zoom Page (XUL/XPCOM) for Firefox, and Zoom Page WE (WebExtensions) for Firefox and Chrome, I think the proposed code changes would be sufficient. 

There is a small difference in how 'Per Tab' zoom works in Firefox and Chrome.  Specifically, when a page is loaded or reloaded, in Firefox the zoom level is unchanged, but in Chrome the zoom level is reset to the site-specific zoom level. However, I don't think this is a big issue.

Would proposed code changes be sufficient and acceptable if I made them ?
Flags: needinfo?(kmaglione+bmo)
No, they wouldn't be sufficient. That preference is global, and the API method is meant to be per-tab. This issue is going to need to be discussed at the next advisory group meeting before we can decide whether we want to implement it.
Flags: needinfo?(kmaglione+bmo)
Of course, you are quite right. I was thinking about what I needed for my Zoom Page WE add-on, which supports per-site zooming for all tabs, or per-tab zooming for all tabs, but not different zoom scopes for individual tabs (which I think would be confusing for users). 

So, all I need is the ability to programmatically change the browser.zoom.siteSpecific preference (or something equivalent to that).

Bearing in mind that the WebExtensions zoom interface currently only supports per-site zooming for all tabs, I don't think we should rule out also supporting per-tab zooming for all tabs, as Firefox does at present, perhaps as an intermediate step to full implementation.
Flags: needinfo?(amckay)
We spoke about this in the advisory-group meeting, my apologies for not updating it sooner. Currently it can be per origin or global, but not per tab. If Firefox supported the ability to zoom per tab then we'd certainly be happy to accept a patch for the WebExtensions API.

At this point our best plan is to probably find a champion about zooming and see if zoom per tab is something that it make sense for Firefox to support. I'll file another bug for that so we can put it in the appropriate component.
Flags: needinfo?(amckay)
Whiteboard: [advisory-group] → [design-decision-approved][triaged]
Depends on: 1337187
Severity: normal → enhancement
Keywords: parity-chrome
Priority: P3 → P5
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.