# Launch Browser

<figure><img src="/files/ToSpVJ9KFYVgUquQhtzR" alt=""><figcaption></figcaption></figure>

The **Launch Browser** block allows you to launch a browser for your TaskBot to use. Subsequent no-code web-interaction blocks (like Click Web Element, Save Web Element, etc) act on the browser context this block launches.

{% hint style="success" %}
This block is one of several ways to launch a browser. You can also launch with an [Open Link](/using-zerowork/using-building-blocks/open-link.md) block or programmatically via `zw.browserContext.launch()` in a [Write JS](/using-zerowork/using-building-blocks/write-javascript.md) block. For the latter, see [Browser Context](/using-zerowork/using-building-blocks/write-javascript/browser-context.md) for the full API.
{% endhint %}

#### How To Use It

This block works with no configuration.

You might not need to use this block. Every setting listed below defaults to **Use current defaults**, which inherits from your TaskBot's **Browser Launch Settings** or any values previously set via `zw.browserContext.setDefaults()` in a Write JS block.

This block lets you override individual settings as needed *during* a TaskBot's run without a Write JS block.

{% hint style="success" %}
These overridden settings become the new defaults for this TaskBot at runtime. To reset or undo, add another Launch Browser block that reverses the previous Launch Browser block's settings prior to subsequent blocks.
{% endhint %}

***

**Launch mode**

<figure><img src="/files/E1wRxekN8WAAMaOVFTDg" alt=""><figcaption></figcaption></figure>

Controls how the browser session is managed.

* **Use current defaults** inherits from your TaskBot's Browser Launch Settings.
* When unchecked, you can choose between:
  * **Incognito** an isolated browser session. No data persists between runs.
  * **Sticky** a persistent browser profile. Cookies, storage, and login state survive between runs. Enter your **Sticky profile ID**. Clicking **COPY PROFILE ID** allows you to select from a list of your available profiles. Your selected sticky profile is copied to your clipboard; paste it into the **Sticky profile ID** field.

{% hint style="success" %}
You can create new sticky profiles in **Browser Launch Settings** to make them available here.
{% endhint %}

***

**Run mode & window**

<figure><img src="/files/aSPEcWkqUCUKerNvFeTX" alt=""><figcaption></figcaption></figure>

**Bypass bot detection**

When enabled, your TaskBot is no longer detectable as bot automation.

{% hint style="warning" %}
When Bypass bot detection is enabled, some settings are ignored (Window size, Launch arguments, Browser) and file uploads larger than approximately 50 MB are blocked. File downloads are unaffected.
{% endhint %}

**Run in background**

Runs the browser in the background with no visible window. Uses fewer resources.

{% hint style="success" %}
When running in background, the browser uses a fixed viewport. If you don't set a **Window size**, the default (1280 x 720) is used.
{% endhint %}

**Maximize**

Maximizes the browser window on launch. Ignored when running in background.

**Window size**

Sets the browser viewport dimensions. This setting only takes effect when **Maximize** is off or **Run in background** is on.

* **Use current defaults** inherits the current viewport size.
* When unchecked, you can set **Width** and **Height** in pixels.

***

**Cookies**

<figure><img src="/files/yM6YtyeZ9qL6ehM8gZBj" alt=""><figcaption></figcaption></figure>

Provide cookies up front so they are reapplied on every context relaunch.

* **Use current defaults** inherits cookies from your Browser Launch Settings.
* When unchecked, paste cookie JSON into the text field. Each cookie should include at least `name`, `value`, and `domain`.
* Click **+ ADD COOKIE** to add cookies from additional websites. Click the trash icon to remove one.

{% hint style="success" %}
See [Cookies](/using-zerowork/general-run-schedule-share-webhooks/cookies.md) for how to export cookies from your browser and use them in ZeroWork.
{% endhint %}

***

**Proxy**

<figure><img src="/files/3mFJ4UsNZYd3sTuYgddx" alt=""><figcaption></figcaption></figure>

Route browser traffic through a proxy server.

* **Use current defaults** inherits proxy settings from your Browser Launch Settings.
* When unchecked:
  * **Proxy server** `host:port` or `socks5://host:port` for SOCKS5 proxies.
  * **Username** HTTP proxy authentication. Not supported for SOCKS5.
  * **Password** HTTP proxy authentication. Not supported for SOCKS5.
  * **Bypass domains** comma-separated domains to bypass the proxy (for example, `example.com, google.com`)

{% hint style="success" %}
See [Proxies](/using-zerowork/general-run-schedule-share-webhooks/proxies.md) for more info on how to use proxies in ZeroWork.
{% endhint %}

***

**Browser**

<figure><img src="/files/hpjJIRKCIIHGUOrQrS3H" alt=""><figcaption></figcaption></figure>

Controls which browser executable to use at runtime.

* **Use current defaults** inherits from your Browser Launch Settings.
* When unchecked, you can choose between:
  * **Default Chrome browser** your installed Chrome is auto-detected and used.
  * **Custom browser** provide a **Browser path** to any Chromium-based browser (Chrome, Brave, Chromium, etc)

{% hint style="success" %}
Not sure where to find your machine's browser path? Open `chrome://version` or `brave://version` in your browser choice and copy the **Executable Path** value.
{% endhint %}

***

**Launch Arguments**

<figure><img src="/files/zWnSzqgpwtbYOjyS3ECJ" alt=""><figcaption></figcaption></figure>

Custom browser executable command line arguments.

* **Use current defaults** inherits from your Browser Launch Settings.
* When unchecked, enter **Chrome command line arguments** as space-separated flags (for example `--mute-audio --disable-notifications`)

{% hint style="warning" %}
Some arguments can interfere with ZeroWork's built-in bot detection bypass and may also prevent the browser from launching. Only add arguments if you know what they do. For a full list of command-line arguments, see [Chromium Command Line Switches](https://peter.sh/experiments/chromium-command-line-switches)
{% endhint %}

***

**Scripts**

<figure><img src="/files/DwoAoOfR1J4wHcvM0txV" alt=""><figcaption></figcaption></figure>

Scripts are injected before any page loads and reinjected on context relaunch.

* **Use current defaults** inherits from your Browser Launch Settings.
* When unchecked, you can add one or more scripts. Each script can be one of:
  * **Path** an absolute file path to a `.js` file (e.g., `/Users/<username>/Documents/script.js`).
  * **Content** inline JavaScript code.
* Click **+ ADD SCRIPT** to add additional scripts. Click the trash icon to remove one.

***

**Page visibility**

<figure><img src="/files/KtppNhMUTa8gN63uRIoY" alt=""><figcaption></figcaption></figure>

**Stay on page after run**

When enabled, the browser stays open after the TaskBot run ends.

{% hint style="warning" %}
**Run in background + Stay on page after run** is not recommended. It leaves an invisible browser consuming resources on your machine after your TaskBot has ended. Additionally, when using [sticky profiles](https://docs.zerowork.io/using-zerowork/using-building-blocks/pages/XWp5BZ8Q3rsexcTMwOM0#id-5.-sticky-browser-profiles-clearprofile-cloneprofile-listprofiles) with this combination, the connection may drop after a long machine sleep, which can block the profile until the Desktop Agent is restarted.
{% endhint %}

#### Things To Know

* **This block always becomes the main browser context.** It replaces any existing browser context. If a [Write JS](/using-zerowork/using-building-blocks/write-javascript.md) block already launched a context, this block replaces it.
* **Settings become defaults for this run.** Whatever you configure in this block becomes the active defaults for the rest of the run until you change it.
* **There's one browser per sticky profile.** Multiple TaskBots with the same sticky profile ID share the same browser instance in parallel tabs. This block attaches to the existing instance if one is already running. When attaching, browser-level settings (Run in background, Bypass bot detection, Maximize, Window size, Browser, Launch arguments) are ignored as they would've already been set when the browser first launched. Cookies, Scripts, and Page visibility settings still apply.
* **Closing the last tab ends the context.** If a [Switch or Close Tab](/using-zerowork/using-building-blocks/switch-or-close-tab.md) block closes the last tab, the context ends. The next [Open Link](/using-zerowork/using-building-blocks/open-link.md) block creates a fresh context from the current defaults.

#### Block Behavior

* **When no browser exists** this block launches a new browser with the configured settings. No URL is opened initially; the browser starts on `about:blank`. Use an [Open Link](/using-zerowork/using-building-blocks/open-link.md) block after this to navigate to a URL.
* **When a browser already exists (from** [Open Link](/using-zerowork/using-building-blocks/open-link.md)**,** [Write JS](/using-zerowork/using-building-blocks/write-javascript.md)**, or a previous Launch Browser block)** this block closes the existing context and launches a new one.
* **When a sticky profile browser is already running from another TaskBot** this block attaches to the existing browser instance. Browser-level settings are ignored. Cookies, Scripts, and Page visibility settings still apply.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zerowork.io/using-zerowork/using-building-blocks/launch-browser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
