# Chrome

The Headless Browser Chrome environment provides high-performance remote browsers running on dedicated servers and using residential proxies for connection. These browser environments are fast, stable, and highly configurable. They can act as a drop-in replacement for your local browser infrastructure.

## Key Features

* Fast and stable performance
* Any proxy country selection
* Compatible with Chrome DevTools Protocol (CDP)

## Connection Details

Connect to UBC using the following WebSocket endpoint:

```
wss://ubc.oxylabs.io
```

## Basic Usage

{% tabs %}
{% tab title="Python (Playwright)" %}

```python
from playwright.sync_api import sync_playwright

username = "your-username"
password = "your-password"
endpoint = "ubc.oxylabs.io"
browser_url = f"wss://{username}:{password}@{endpoint}"

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(browser_url)
    page = browser.new_page()
    page.goto('https://example.com')
    browser.close()
```

{% endtab %}

{% tab title="JavaScript (Playwright)" %}

```javascript
import { chromium } from 'playwright';

(async () => {
    const username = 'your-username';
    const password = 'your-password';
    const endpoint = 'ubc.oxylabs.io';
    const browserUrl = `wss://${username}:${password}@${endpoint}`;

    const browser = await chromium.connectOverCDP(browserUrl);
    const page = await browser.newPage();
    await page.goto('https://example.com');
    await browser.close();
})();
```

{% endtab %}

{% tab title="JavaScript (Puppeteer)" %}

```javascript
import puppeteer from 'puppeteer';

(async () => {
  const username = 'your-username';
  const password = 'your-password';
  const endpoint = 'ubc.oxylabs.io';
  const browserUrl = `wss://${username}:${password}@${endpoint}`;

  const browser = await puppeteer.connect({
    browserWSEndpoint: browserUrl
  });
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await browser.close();
})();
```

{% endtab %}
{% endtabs %}

## United States Proxy Infrastructure

Users, who mainly operate in the US, can connect directly to US-based infrastructure via the special entry point. This ensures faster loading time and better browsing efficiency. To establish connection, enter the following:

```
wss://ubc-us.oxylabs.io
```

Code examples:

{% tabs %}
{% tab title="Python (Playwright)" %}

```python
from playwright.sync_api import sync_playwright

username = "your-username"
password = "your-password"
endpoint = "ubc-us.oxylabs.io"
browser_url = f"wss://{username}:{password}@{endpoint}"

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(browser_url)
    page = browser.new_page()
    page.goto('https://example.com')
    browser.close()
```

{% endtab %}

{% tab title="JavaScript (Playwright)" %}

```javascript
import { chromium } from 'playwright';

(async () => {
    const username = 'your-username';
    const password = 'your-password';
    const endpoint = 'ubc-us.oxylabs.io';
    const browserUrl = `wss://${username}:${password}@${endpoint}`;

    const browser = await chromium.connectOverCDP(browserUrl);
    const page = await browser.newPage();
    await page.goto('https://example.com');
    await browser.close();
})();
```

{% endtab %}

{% tab title="JavaScript (Puppeteer)" %}

```javascript
import puppeteer from 'puppeteer';

(async () => {
  const username = 'your-username';
  const password = 'your-password';
  const endpoint = 'ubc-us.oxylabs.io';
  const browserUrl = `wss://${username}:${password}@${endpoint}`;

  const browser = await puppeteer.connect({
    browserWSEndpoint: browserUrl
  });
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await browser.close();
})();
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note:** this solution primarily shortens the response time for the US-based users, and should not be confused with proxy geo-location selection. More on that in the following section.&#x20;
{% endhint %}

## Browser Arguments

Headless Browser Chrome accepts additional browser arguments passed with connection URL in the format of `?bargs=`. These GET parameters specify command-line arguments that browsers should be started with.&#x20;

1. If the argument should have value, we use `bargs=argname:argvalue`;
2. If the argument is just a flag, we use `bargs=flagname` .

Currently, Oxylabs Headless Browser Chrome supports the following arguments:

<table><thead><tr><th width="350.1015625">Argument</th><th>Description</th></tr></thead><tbody><tr><td><code>force-color-profile:&#x3C;profile></code></td><td>Force all monitors to be treated as though they have the specified color profile.</td></tr><tr><td><code>window-position:X,Y</code></td><td>Specifies the initial window position.</td></tr><tr><td><code>hide-scrollbars</code></td><td>Prevents creating scrollbars for web content – useful for taking consistent screenshots.</td></tr><tr><td><code>enable-features:&#x3C;feature1>,&#x3C;feature2>,&#x3C;feature3></code></td><td>Comma-separated list of feature names to enable.</td></tr><tr><td><code>disable-notifications</code></td><td>Disables the Web Notification and the Push APIs.</td></tr></tbody></table>

Usage example:

{% tabs %}
{% tab title="Python (Playwright)" %}

```python
from playwright.sync_api import sync_playwright

username = "your-username"
password = "your-password"
endpoint = "ubc.oxylabs.io"
browser_url = f"wss://{username}:{password}@{endpoint}/?bargs=force-color-profile:srgb&bargs=window-position:100,100"

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(browser_url)
    page = browser.new_page()
    page.goto('https://example.com')
    browser.close()
```

{% endtab %}
{% endtabs %}


---

# 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://developers.oxylabs.io/scraping-solutions/headless-browser/chrome.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.
