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

# unroute(url)

The method removes all routes for the `url`, that were previously added with [`page.route`](/docs/k6/latest/javascript-api/k6-browser/page/route/).

Expand table

| Parameter | Type             | Default | Description                                                                                                                  |
|-----------|------------------|---------|------------------------------------------------------------------------------------------------------------------------------|
| url       | string or Regexp | `''`    | The exact URL that was used in the [`page.route(url, handler)`](/docs/k6/latest/javascript-api/k6-browser/page/route/) call. |

## Returns

Expand table

| Type            | Description                                                              |
|-----------------|--------------------------------------------------------------------------|
| `Promise<void>` | A Promise that fulfills when the route(s) is(are) removed from the page. |

## 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();

  // Abort all image requests
  await page.route(/(\.png$)|(\.jpg$)/, async function (route) {
    await route.abort();
  });

  await page.goto('https://quickpizza.grafana.com/');

  await page.getByRole('button', { name: 'Pizza, Please!' }).click();

  // Stop aborting all image requests
  await page.unroute(/(\.png$)|(\.jpg$)/)

  await page.close();
}
```
