---
title: "opener() | Grafana k6 documentation"
description: "Browser module: page.opener method"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# opener()

Returns the page that opened the current page. The first page that is navigated to will have a `null` opener.

### Returns

Expand table

| Type                                                            | Description                                   |
|-----------------------------------------------------------------|-----------------------------------------------|
| null or [Page](/docs/k6/latest/javascript-api/k6-browser/page/) | The `Page` instance. Else, it returns `null`. |

### Returns

Expand table

| Type                   | Description                                                    |
|------------------------|----------------------------------------------------------------|
| `Promise<Page | null>` | A Promise that fullfils with the `Page` instance, else `null`. |

### Example

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    browser: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  await page.goto('https://test.k6.io/browser.php');
  console.log(await page.opener());
}
```
