tabs.setZoomSettings()

Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.

Syntax

browser.tabs.setZoomSettings(
  tabId,           // optional integer
  zoomSettings,    // ZoomSettings
  function() {...} // optional function
)

Parameters

tabIdOptional
integer. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window.
zoomSettings
tabs.ZoomSettings. Defines how zoom changes are handled and at what scope.

Values of this type are objects. They contain the following properties:

modeOptional
tabs.ZoomSettingsMode. Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to automatic.
scopeOptional
tabs.ZoomSettingsScope. Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin when in automatic mode, and per-tab otherwise.
defaultZoomFactorOptional
number. Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings.
callbackOptional
function. Called after the zoom settings have been changed.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic supportNo

Examples

Acknowledgements

This API is based on Chromium's chrome.tabs API. This documentation is derived from tabs.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,