{"id":16397380,"url":"https://github.com/foxriver76/iobroker.puppeteer","last_synced_at":"2025-07-31T04:38:51.641Z","repository":{"id":57686896,"uuid":"486143884","full_name":"foxriver76/ioBroker.puppeteer","owner":"foxriver76","description":"Adapter to control a headless browser to take screenshots of web pages.","archived":false,"fork":false,"pushed_at":"2024-09-17T14:53:10.000Z","size":341,"stargazers_count":2,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T00:56:14.100Z","etag":null,"topics":["iobroker","iot","screenshot","smarthome"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foxriver76.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null},"funding":{"github":"foxriver76","custom":"https://www.paypal.me/foxriver76"}},"created_at":"2022-04-27T10:18:45.000Z","updated_at":"2025-03-26T19:29:25.000Z","dependencies_parsed_at":"2024-01-09T14:58:56.774Z","dependency_job_id":"56df6505-5490-4c24-9abd-46bc3425a1fb","html_url":"https://github.com/foxriver76/ioBroker.puppeteer","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/foxriver76/ioBroker.puppeteer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxriver76%2FioBroker.puppeteer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxriver76%2FioBroker.puppeteer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxriver76%2FioBroker.puppeteer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxriver76%2FioBroker.puppeteer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxriver76","download_url":"https://codeload.github.com/foxriver76/ioBroker.puppeteer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxriver76%2FioBroker.puppeteer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267988489,"owners_count":24176996,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["iobroker","iot","screenshot","smarthome"],"created_at":"2024-10-11T05:09:57.790Z","updated_at":"2025-07-31T04:38:51.607Z","avatar_url":"https://github.com/foxriver76.png","language":"TypeScript","funding_links":["https://github.com/sponsors/foxriver76","https://www.paypal.me/foxriver76"],"categories":[],"sub_categories":[],"readme":"![Logo](admin/puppeteer.png)\n# ioBroker.puppeteer\n\n[![NPM version](https://img.shields.io/npm/v/iobroker.puppeteer.svg)](https://www.npmjs.com/package/iobroker.puppeteer)\n[![Downloads](https://img.shields.io/npm/dm/iobroker.puppeteer.svg)](https://www.npmjs.com/package/iobroker.puppeteer)\n![Number of Installations](https://iobroker.live/badges/puppeteer-installed.svg)\n![Current version in stable repository](https://iobroker.live/badges/puppeteer-stable.svg)\n\n[![NPM](https://nodei.co/npm/iobroker.puppeteer.png?downloads=true)](https://nodei.co/npm/iobroker.puppeteer/)\n\n**Tests:** ![Test and Release](https://github.com/foxriver76/ioBroker.puppeteer/workflows/Test%20and%20Release/badge.svg)\n\n## puppeteer adapter for ioBroker\n\nHeadless browser to generate screenshots based on Chrome\n\n## Disclaimer\nPuppeteer is a product of Google Inc. The developers of this module are in no way endorsed by or affiliated with Google Inc., \nor any associated subsidiaries, logos or trademarks.\n\n## How-To\nThe adapter is fully configurable via states and does not provide settings in the admin interface.\nThe states (besides `url`) will not get any ack-flag by the adapter and ack-flags are ignored in general.\n\n### States\n\n#### filename\nSpecify the filename (full path) of the image.\n\n#### url\nSpecify the url you want to take a screenshot from. If the state is written, a screenshot will be created immediately.\nAfter the screenshot is created, the adapter will set the ack flag of url state to true.\n\n#### fullPage\nIf this state evaluates to true, it will perform a screenshot of the full page. The crop options will be ignored.\n\n#### cropLeft/Top/Height/Width\nConfigure the crop options in `px` to only screenshot the desired segment of the page. \nIf `fullPage` is set to true, no cropping will be performed.\n\n#### waitForSelector\nThe screenshot will be taken after the selector is visible on the page e.g. `#time`. If `waitForSelector` is active, \nother wait oeprations like `renderTime` are ignored.\n\n#### renderTime\nInterval in ms to wait till the page will be rendered\n\n### Messages\nAlternatively you can take screenshots by sending messages to the adapter.\nAll options beside from `url` and `ioBrokerOptions` are passed directly to the Puppeteer API, the currently supported parameters can be found\nbelow, for a more up-to-date version check the [API description](https://pptr.dev/api/puppeteer.screenshotoptions). \nAdditionally, you can define a `waitOption` to wait for a given time or for a selector. Finally, you can use the `ioBrokerOptions.storagePath` \noption to save screenshots directly to the ioBroker storage under `0_userdata.0` which can then be viewed via admin and visualization adapters.\n\n```typescript\nsendTo('puppeteer.0', 'screenshot', { url: 'https://www.google.com',\n      ioBrokerOptions?: {\n        /**\n         * Define a filename for the ioBroker storage e.g. test.png\n         */\n        storagePath: string;\n      },\n      /**\n       * Define at most one wait option\n       * You can also look for other waitOptions currently supported by Puppeteer API\n       * see e.g. https://puppeteer.github.io/puppeteer/docs/puppeteer.page.waitforfilechooser\n       */\n      waitOption?: {\n        /**\n         * Define a Timeout in ms\n         */\n        waitForTimeout?: 5000,\n    \n        /**\n         * Wait for a given id/tag/etc to be occured\n         */\n        waitForSelector?: '#testId'\n      },\n      /**\n       * Optionally, specify the viewport manually, see https://pptr.dev/api/puppeteer.viewport\n       */\n      viewportOptions?: {\n        width: 800,\n        height: 600\n      },\n      /**\n       * The file path to save the image to. The screenshot type will be inferred\n       * from file extension. If path is a relative path, then it is resolved\n       * relative to current working directory. If no path is provided, the image\n       * won't be saved to the disk.\n       */\n      path?: string,\n      /**\n       * When true, takes a screenshot of the full page.\n       * @defaultValue false\n       */\n      fullPage?: boolean,\n      /**\n       * An object which specifies the clipping region of the page.\n       */\n      clip?: {         \n        x: number,\n        y: number,\n        width: number,\n        height: number \n      };\n      /**\n       * Quality of the image, between 0-100. Not applicable to `png` images.\n       */\n      quality?: number,\n      /**\n       * Hides default white background and allows capturing screenshots with transparency.\n       * @defaultValue false\n       */\n      omitBackground?: boolean,\n      /**\n       * Encoding of the image.\n       * @defaultValue 'binary'\n       */\n      encoding?: 'base64' | 'binary',\n      /**\n       * If you need a screenshot bigger than the Viewport\n       * @defaultValue true\n       */\n      captureBeyondViewport?: boolean,\n  }, obj =\u003e {\n      if (obj.error) {\n        log(`Error taking screenshot: ${obj.error.message}`, 'error');\n      } else {\n        // the binary representation of the image is contained in `obj.result`\n        log(`Successfully took screenshot: ${obj.result}`);\n      }\n});\n```\n\n## Changelog\n\u003c!--\n    Placeholder for the next version (at the beginning of the line):\n    ### **WORK IN PROGRESS**\n--\u003e\n### 0.4.0 (2024-09-17)\n* (@foxriver76) updated puppeteer dependency\n* (@foxriver76) allow to specify an external browser for puppeteer\n\n### 0.3.0 (2024-05-19)\n* (foxriver76) allowed to specify additional arguments for the puppeteer process\n* (foxriver76) updated puppeteer dependency\n\n### 0.2.8 (2024-01-09)\n* (foxriver76) update puppeteer dependency\n\n### 0.2.7 (2023-03-18)\n* (foxriver76) update puppeteer dependency\n\n### 0.2.6 (2022-08-14)\n* (foxriver76) we now close the page also when screenshot taken via message\n\n### 0.2.5 (2022-08-14)\n* (foxriver76) we have optimized the viewport option\n\n### 0.2.4 (2022-08-12)\n* (foxriver76) allow settings viewport options\n* (foxriver76) the default viewport is now the max resolution\n\n### 0.2.3 (2022-08-12)\n* (foxriver76) optimized path check for relative paths\n\n### 0.2.1 (2022-06-09)\n* (foxriver76) we now install required shared libraries on adapter installation on linux\n\n### 0.2.0 (2022-05-20)\n* (foxriver76) added option to save files to the ioBroker storage via messages by using `ioBrokerOptions.storagePath` (closes #2)\n\n### 0.1.0 (2022-05-16)\n* (foxriver76) initial release\n\n## License\nMIT License\n\nCopyright (c) 2024 Moritz Heusinger \u003cmoritz.heusinger@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxriver76%2Fiobroker.puppeteer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxriver76%2Fiobroker.puppeteer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxriver76%2Fiobroker.puppeteer/lists"}