@shirabe/useragent
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@shirabe/useragent

Checker for accessing User Agent String in websites.

Usage

❯ cat config.json
{
  "urls": [
    "https://...",
    "https://..."
  ]
}

❯ npx --yes @shirabe/useragent config.json > output.json

Options

Emulate devices (Pixel 2 XL):

{
  "urls": {
      "https://..."
  },
  "options": {
    "browserContextOptions": {
      "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",
      "viewport": {
        "width": 411,
        "height": 823
      },
      "deviceScaleFactor": 3.5,
      "isMobile": true,
      "hasTouch": true,
      "defaultBrowserType": "chromium"
    }
  }
}

Config Reference: https://github.com/microsoft/playwright/blob/master/src/server/deviceDescriptors.js

Readme

Keywords

none

Package Sidebar

Install

npm i @shirabe/useragent

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

10.6 kB

Total Files

11

Last publish

Collaborators

  • progfay