{"id":14984397,"url":"https://github.com/n0tan3rd/chrome-remote-interface-extra","last_synced_at":"2025-04-10T20:11:18.691Z","repository":{"id":34182153,"uuid":"163722109","full_name":"N0taN3rd/chrome-remote-interface-extra","owner":"N0taN3rd","description":"Like fs-extra but for the chrome-remote-interface-extra by cyrus-and","archived":false,"fork":false,"pushed_at":"2023-08-12T03:43:35.000Z","size":12912,"stargazers_count":23,"open_issues_count":23,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T18:37:56.047Z","etag":null,"topics":["browser","chrome","chrome-debugging-protocol","chrome-remote-interface","google-chrome","headless","puppeteer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/N0taN3rd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-01-01T07:58:54.000Z","updated_at":"2025-03-25T21:59:29.000Z","dependencies_parsed_at":"2024-04-08T16:07:55.592Z","dependency_job_id":"3ec4eeb1-3930-492f-9288-6a39434b0305","html_url":"https://github.com/N0taN3rd/chrome-remote-interface-extra","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"1c57e0d8ea19969a4373af45daf557960c4f1c64"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0taN3rd%2Fchrome-remote-interface-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0taN3rd%2Fchrome-remote-interface-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0taN3rd%2Fchrome-remote-interface-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0taN3rd%2Fchrome-remote-interface-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/N0taN3rd","download_url":"https://codeload.github.com/N0taN3rd/chrome-remote-interface-extra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288357,"owners_count":21078903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","chrome","chrome-debugging-protocol","chrome-remote-interface","google-chrome","headless","puppeteer"],"created_at":"2024-09-24T14:08:58.865Z","updated_at":"2025-04-10T20:11:18.672Z","avatar_url":"https://github.com/N0taN3rd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"chrome-remote-interface-extra\n=======================\n[![NPM chrome-remote-interface-extra package](https://img.shields.io/npm/v/chrome-remote-interface-extra.svg?style=flat-square)](https://npmjs.org/package/chrome-remote-interface-extra) \n[![node requirement](https://img.shields.io/badge/node-%3E%3D%208.6.0-brightgreen.svg?style=flat-square)](https://nodejs.org) \n[![never semis](https://img.shields.io/badge/code_style-prettier--standard-ff69b4.svg?style=flat-square)](https://github.com/sheerun/prettier-standard) \n[![sanic](https://img.shields.io/badge/speed-blazing%20%F0%9F%94%A5-brightgreen.svg?style=flat-square)](https://twitter.com/acdlite/status/974390255393505280)\n\nThe chrome-remote-interface-extra brings a [GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer) like api to the [chrome-remote-interface-extra](https://github.com/cyrus-and/chrome-remote-interface) by [cyrus-and](https://github.com/cyrus-and) :heart:, as well as, making many of the full CDP values puppeteer hides available.\n\n## Getting Started\n\n### Installation\nTo use chrome-remote-interface-extra in your project, run:\n\n```bash\nyarn add chrome-remote-interface-extra\n# or \"npm i chrome-remote-interface-extra\"\n```\n\nNote: The chrome-remote-interface-extra differs from puppeteer in that you must BYOB (bring your own browser). \n\n### Documentation\n  - this library: https://n0tan3rd.github.io/chrome-remote-interface-extra/\n  - for chrome-remote-interface: https://github.com/cyrus-and/chrome-remote-interface\n\n### Usage\nNote: chrome-remote-interface-extra requires at least Node v8.6.0 (according to [node.green](https://node.green/)) and is tested on the latest version of [Node](https://nodejs.org/en/download/current/)\n\n**Example** - navigating to [fairly complicated single page application (SPA)](https://webrecorder.io/jberlin/archival-acid-test-v2/list/bookmarks/b1/20170810014348/http://wsdl-docker.cs.odu.edu:8080/tests/reactSPA/) and saving a screenshot as *wr.png*:\n\n\n```javascript\nconst { CRIExtra, Browser } = require('chrome-remote-interface-extra')\n\nconst fairlyComplicatedPage =\n  'https://webrecorder.io/jberlin/archival-acid-test-v2/list/bookmarks/b1/20170810014348/http://wsdl-docker.cs.odu.edu:8080/tests/reactSPA/'\n\nasync function webercorderIOScreenshot () {\n  let client\n  let browser\n  try {\n    client = await CRIExtra({ host: 'localhost', port: 9222 })\n    browser = await Browser.create(client, {\n      contextIds: [],\n      ignoreHTTPSErrors: true\n    })\n    const page = await browser.newPage()\n    await page.goto(fairlyComplicatedPage, { waitUntil: 'domcontentloaded' })\n    await page.networkIdlePromise()\n    await page.screenshot({ path: 'wr.png' })\n    await browser.close()\n  } catch (err) {\n    console.error(err)\n  } finally {\n    if (browser) {\n      await browser.close()\n    } else if (client) {\n      await client.close()\n    }\n  }\n}\n\nwebercorderIOScreenshot().catch(error =\u003e {\n  console.error('Screenshot failed', error)\n})\n```\n\nAdditional examples can be derived from looking over this project's [test suite](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/test)\n\n# FAQ\n\n#### Q: Why\n\nSimply put, puppeteer's abstractions around the Chrome DevTools Protocol (CDP) are fantastic except for one thing its Googley (not easily extendable beyond their own vision for the project). \n\nThe chrome-remote-interface by cyrus-and is a building block not an opinion, so why not build on top of it like [jprichardson](https://github.com/jprichardson) did for [fs-extra](https://github.com/jprichardson/node-fs-extra).\n\n#### Q: Who maintains chrome-remote-interface-extra?\n\n[N0tan3rd](https://twitter.com/johnaberlin) and the community! Lets build something together!\n\n#### Q: What are chrome-remote-interface-extra’s goals and principles?\n\nThe goals of the project is to add extra utility to the chrome-remote-interface by\n- **Use open source projects and not re-invent the wheel!**\n- Make each part of the CDP abstractions divisible not in-divisible as is the case with  puppeteer (when possible)\n- Adding additional abstractions that are currently missing from puppeteer\n- Allowing more control over the abstractions rather relying on a singular opinion about how things should be done\n\n\n#### Q: Is chrome-remote-interface-extra replacing Selenium/WebDriver?\n\n**It should**. Both Selenium/WebDriver can not provide you with access to the heart beat of the browser which is required for modern day web pages and [use cases](https://github.com/N0taN3rd/Squidwarc).\n\n#### Q: Whats different from puppeteer / the extra utility you speak off\n\nAn non-exhaustive overview of the differences/additions is provided below.\nA full listing can be found by consulting our [documentation](https://n0tan3rd.github.io/chrome-remote-interface-extra/)\n\nAdded `util.inspect.custom` definitions to majority of classes so they play nicely with console.log and util.inspect\n\nAdded `toJSON` to CDP Type classes so that their values can easily be serialized to disk for latter computation\n\n#### Animation Domain: Tweak and inspect your animations\n - Animation [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/animations/Animation.js) \n- AnimationManger [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/animations/AnimationManager.js)\n\n#### Cookie [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/network/Cookie.js)\n - an abstraction around using the CDP and Cookies\n - full CDP values\n - modify, delete, add, list\n - integrated with Page and NetworkManager\n\n#### Database Domain: You should see whats in your browsers database\n- Database [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/database/Database.js)\n- DatabaseManager [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/database/DatabaseManager.js)\n\n\n#### Inspection and retrieval of per frame resources\n- FrameResource [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/frames/FrameResource.js)\n- FrameResourceTree [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/frames/FrameResourceTree.js)\n\n### ServiceWorkers!\n- ServiceWorker [(new class)](https://github.com/N0taN3rd/chrome-remote-interface-extra/blob/master/lib/workers/ServiceWorker.js) \n\n#### Page\n - now exposes: networkManager, frameManager\n - getAppManifest: get pages app manifest\n - configurable additional domains: no more extra noise, unless that noise is the kind you like \\m/, only the minimum number of domains required to use the base page functionality are enabled by default\n - raw CDP methods addScriptToEvaluateOnNewDocument and removeScriptToEvaluateOnNewDocument exposed!!\n - set download behavior\n - ability to force the page to stop loading\n\n#### Page, Frame, DOMWorld\n - added querySelector: an alias for $\n - added querySelectorAll: an alias for $$\n - added querySelectorEval: an alias for $eval\n - added querySelectorAllEval: an alias for $$eval\n - added xpathQuery: an alias for $x\n - added getElementById: as the name implies\n \n#### Page, NetworkManager\n  - configure a set of URL that are to be blocked\n  - get DER-encoded certificate(s)\n  - force HTTP requests to bypass service worker (service workers coming sometime, PR? this project really likes community contributions)\n  - new wait: true network idle that considers the cumulative network state\n  - disable network and browser cache\n  - ability to change the Accept-Language HTTP header, the platform returned by navigator.platform\n\n#### Frame\n - added fromCDPFrame, a static method for creation of a Frame using the full CDP Type Frame values\n - Exposed all CDP Frame Type values via the Frame class\n\n#### FrameManager, Page\n - added getResourceTree: function returning the resource tree (FrameResourceTree instance) for the page currently under control\n - added getFrameResourceContent: function allowing the retrial of the contents of a resource give a frameId and URL\n\n#### Request, Response\n - full CDP values exposed\n - additional utility functions added (recreate raw HTTP message)\n\n#### Browser\n - ability to retrieve the full browser version information\n - ability to list all browser contexts, not just those created by the library\n - ability to list all targets, not just those created by the library\n - browser histograms\n \n#### Browser, BrowserContext, Target\n - expose CDP for some target\n - manipulate the actual browser window not just the view port \n \n#### Target\n - Does not require Browser or BrowserContext, can now operate independently\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0tan3rd%2Fchrome-remote-interface-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn0tan3rd%2Fchrome-remote-interface-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0tan3rd%2Fchrome-remote-interface-extra/lists"}