Skip to content

Latest commit

 

History

History

resize-tab

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

resizeTab(tab, width, height)

Changes the size of the viewport of a tab

Example

import { openBrowser, openTab, resizeTab } from 'puppet-strings'

async function run() {
  const browser = await openBrowser('google-chrome')
  const tab = await openTab(browser, 'http://example.com')
  await resizeTab(tab, 1200, 800)
}

run()

Parameters

  • tab (Tab)
  • width (number)
  • height (number)

Returns

  • promise (Promise)

Details

The size of the viewport is changed, meaning window.innerWidth and window.innerHeight. The actual Chrome window will be slightly larger.

Only the given tab will be affected; other tabs will keep their current size.