npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@browserless/goto

v10.11.4

Published

Navigate to web pages with built-in ad blocking, device emulation, and optimized loading for faster automation.

Readme

@browserless/goto: Go to a page aborting unnecessary requests.

See the Go To section on our website for more details.

Install

Using npm:

npm install @browserless/goto --save

About

This package provides advanced page navigation with built-in ad blocking, smart waiting strategies, and extensive customization options. It's the core navigation engine that powers all browserless page loading operations.

What this package does

The @browserless/goto package allows you to:

  • Navigate to pages with optimized loading and smart waiting strategies
  • Block ads and trackers using a precompiled Ghostery ad-blocker engine
  • Inject scripts, modules, and styles into pages
  • Emulate devices with viewport, user agent, and media features
  • Intercept and abort requests by resource type
  • Handle cookies and authentication seamlessly

Usage

const createGoto = require('@browserless/goto')
const puppeteer = require('puppeteer')

const goto = createGoto({ 
  timeout: 30000,
  defaultDevice: 'Macbook Pro 13'
})

const browser = await puppeteer.launch()
const page = await browser.newPage()

const { response, device, error } = await goto(page, {
  url: 'https://example.com',
  adblock: true,
  waitUntil: 'auto'
})

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | url | string | — | Target URL to navigate to | | html | string | — | HTML content to render (instead of URL) | | adblock | boolean | true | Enable built-in ad blocker | | waitUntil | string\|string[] | 'auto' | Navigation wait condition | | timeout | number | 30000 | Navigation timeout in ms | | device | string | 'Macbook Pro 13' | Device to emulate | | headers | object | {} | Extra HTTP headers | | javascript | boolean | true | Enable/disable JavaScript | | animations | boolean | false | Enable CSS animations | | colorScheme | string | — | 'light' or 'dark' preference | | mediaType | string | — | CSS media type ('screen', 'print') | | timezone | string | — | Timezone to emulate | | authenticate | object | — | HTTP authentication credentials | | scripts | string\|string[] | — | Scripts to inject | | modules | string\|string[] | — | ES modules to inject | | styles | string\|string[] | — | Stylesheets to inject | | click | string\|string[] | — | CSS selectors to click | | scroll | string | — | CSS selector to scroll into view | | abortTypes | string[] | [] | Resource types to abort | | waitForSelector | string | — | Wait for selector to appear | | waitForFunction | string | — | Wait for function to return truthy | | waitForTimeout | number | — | Wait for specified milliseconds | | onPageRequest | function | — | Request interception handler |

Smart waiting with waitUntil: 'auto'

The default 'auto' mode intelligently waits for page readiness:

// Auto mode combines 'load' with 'networkidle2' smartly
await goto(page, { url: 'https://example.com', waitUntil: 'auto' })

// Standard Puppeteer wait conditions also supported
await goto(page, { url: 'https://example.com', waitUntil: 'networkidle0' })
await goto(page, { url: 'https://example.com', waitUntil: ['load', 'domcontentloaded'] })

Built-in Ad Blocker

The package includes a precompiled Ghostery ad-blocker engine that blocks ads and trackers automatically:

// Enabled by default
await goto(page, { url: 'https://example.com', adblock: true })

// Disable for specific pages
await goto(page, { url: 'https://example.com', adblock: false })

// The adblocker can be disabled mid-session
page.disableAdblock()

Cookie consent handling (opt-out) is included as part of adblock: true and powered by duckduckgo/autoconsent.

Script and style injection

Inject external resources or inline code:

await goto(page, {
  url: 'https://example.com',
  // External URLs
  scripts: ['https://cdn.example.com/library.js'],
  // ES modules
  modules: ['https://cdn.example.com/module.mjs'],
  // CSS (URLs, paths, or inline)
  styles: [
    'https://cdn.example.com/styles.css',
    'body { background: red; }'
  ]
})

Request interception

Abort specific resource types to speed up navigation:

await goto(page, {
  url: 'https://example.com',
  abortTypes: ['image', 'stylesheet', 'font', 'media'],
  onPageRequest: (request, page) => {
    console.log('Request:', request.url())
  }
})

Device emulation

// Use preset device
await goto(page, { url: 'https://example.com', device: 'iPhone 13' })

// Custom viewport
await goto(page, {
  url: 'https://example.com',
  viewport: { width: 1920, height: 1080 }
})

// Custom headers
await goto(page, {
  url: 'https://example.com',
  headers: {
    'user-agent': 'custom-agent',
    'cookie': 'session=abc123'
  }
})

Return value

The goto function returns:

const { response, device, error } = await goto(page, { url })

// response: Puppeteer Response object (or undefined if navigation failed)
// device: { userAgent, viewport } used for the request
// error: Error object if navigation failed

How it fits in the monorepo

This is the core navigation engine used by the entire browserless ecosystem:

| Consumer | Purpose | |----------|---------| | browserless (core) | Powers .goto(), .html(), .text(), .pdf(), .screenshot() | | @browserless/screenshot | Navigation before capturing screenshots | | @browserless/pdf | Navigation before generating PDFs | | @browserless/function | Navigation for sandboxed function execution | | @browserless/lighthouse | Navigation for Lighthouse audits |

Dependencies

| Package | Purpose | |---------|---------| | @browserless/devices | Device descriptor lookups and emulation | | @ghostery/adblocker-puppeteer | Ad and tracker blocking | | debug-logfmt | Structured debug logging | | got | HTTP client for postinstall script | | is-url-http | Detect if value is URL for injection | | p-reflect / p-timeout | Promise utilities for timeouts | | shallow-equal | Viewport comparison optimization | | tough-cookie | Cookie string parsing |

License

@browserless/goto © Microlink, released under the MIT License. Authored and maintained by Microlink with help from contributors.

The logo has been designed by xinh studio.

microlink.io · GitHub microlinkhq · X @microlinkhq