Block reference / Browser

Close tab/window

Closes the tab the workflow is using, the tabs that match a pattern, or every window.

Only inWarpX Browser

Close tab/window closes pages in the profile's browser. It can close the tab the workflow is working in, every tab whose address matches a pattern, or all windows. Use it to tidy up popups and extra tabs, or to end a session cleanly.

The Close tab/window block's settings, filled in as in the example below.

Settings

tab / window

The unlabelled list at the top. Choose tab to close tabs or window to close windows.

Exampletab
Close active tabwhen the list is tab

Tick it to close the tab the workflow is using. Untick it to close tabs by address with Match Patterns instead.

ExampleUnchecked
Match Patternswhen the list is tab and Close active tab is off

A match pattern such as *://*.example.com/*. Every open tab in the profile's browser whose address matches is closed. You can use references such as {{variables.helpUrl}}.

Example*://help.example.com/*
Close all windowswhen the list is window

Tick it to close every page in the profile's browser, including pages the workflow did not open. Untick it to close only the current window, which in WarpX Browser is the page the workflow is using.

ExampleUnchecked

Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.

What it hands on

Leaves by its only output. It writes nothing. Closing a tab that is already gone is not an error.

Example: Close the help centre tab a page opened

  1. Open URL
  2. Click element
  3. Close tab/window
  4. Get text
Where Close tab/window sits in the example workflow.
  1. Add Open URL with https://shop.example.com/account.
  2. Add Click element on a.help-link. The site opens https://help.example.com/ in a new tab.
  3. Add Close tab/window. Leave the list on tab and untick Close active tab.
  4. In Match Patterns, type *://help.example.com/*.
  5. Add Get text on .account-name. It still runs on the account page, because the workflow never left it.

Good to know

  • After Close active tab, or after window mode, the page the workflow was using is gone. Add Open URL, New tab or Switch tab before any block that works on a page. Otherwise that block fails.
  • If Match Patterns matches the tab the workflow is using, that tab closes but the workflow still points at it. Later page blocks fail until you add Switch tab or Open URL.
  • <all_urls> is not understood as a match pattern here and matches nothing. Use *://*/* instead.
  • In WarpX Browser, window with Close all windows unticked closes the page the workflow is using, the same as tab with Close active tab. The profile's other pages stay open.
  • Close all windows closes every page in the profile's browser.

See also

  • Switch tab — Move the run to another open tab, found by its address, its title or its position.
  • New tab — Opens an address in a new tab of the profile's browser and moves the workflow onto it.
  • Open URL — Load a web address in the current tab or a new one, and wait for it to load.
  • New window — Open a web address in a new window of the profile's browser, and carry on in it.