Skip to content

Switch Tab

Switch to another page and set it as the active page.

TIP

I will use the Delay node before using this node.

Match Pattern

Switch to the page that matches the provided URL.

Example

For example, if I want to switch to the page with the URL https://www.youtube.com/, I just need to select the Match patterns option and paste the URL of the page I want to switch to.

tabs

title

Alternatively, I can use it in a different way.

Here, I need to connect a wallet in a testnet project.

title

After clicking connect wallet with the MetaMask wallet, a new tab will be created and displayed as follows:

title

At this point, I need to switch to that tab to perform the click action on the Connect button.

To get the URL of that tab, I click on the tab, then press F12 or right-click on the tab and select Inspect.

title

A new tab will then be displayed. I switch to the Console tab, type the command location.href, and press Enter.

title

title

Next, copy the displayed text. For example, the link here would be: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/notification#connect/hy4UvYG9TZo2-_5AC3bJ6

I cannot use this link directly because the characters after connect are random numbers, and each account will have a different string. Therefore, to use it, I should modify it to a link like this: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/notification#/connect/*

title

By doing this, the node will automatically switch to any tab with a URL starting with this link, regardless of the characters after connect/. Then, I can interact with that OKX tab.

TIP

If there are multiple pages with similar URLs, it will switch to the first page from left to right.

Tab Title

Switch to the page with the corresponding title.

Example

Here, I need to connect a wallet in a testnet project.

title

After clicking connect wallet with the OKX wallet, a new tab will be created and displayed as follows:

title

At this point, I need to switch to that tab to perform the click action on the Connect button.

To get the URL of that tab, I click on the tab, then press F12 or right-click on the tab and select Inspect.

title

A new tab will then be displayed. I switch to the Console tab, type the command document.title, and press Enter.

titletitle

Next, copy the displayed text. For example, the text here would be: MetaMask

Now, I enter this title into the Switch Tab node as follows:

title

By doing this, the node will automatically switch to the tab with a title matching the one in the node.

Next Tab

Switch to the next page to the right of the currently active page.

Example

The current active page is Youtube.

title

When selecting to switch to the next page, the active page will be Ebay.

title

Previous Tab

Switch to the previous page to the left of the currently active page.

Example

For example, the current active page is Youtube.

title

When selecting to switch to the previous page, the active page will be Google.

title

Tab Index

Switch to a page based on its order position.

Example

For example, there are 3 pages in the browser window (Google, Youtube, Ebay).

tabs

To switch to the Google page, I can enter 0, for Youtube enter 1, and so on.

tabs