homebridge-website-to-camera
Advanced tools
Comparing version 1.5.3 to 1.6.0
@@ -15,3 +15,3 @@ "use strict"; | ||
this.streamControllers = []; | ||
this.screenshotHelper = new ScreenshotHelper(log, conf.url, conf.chromiumPath); | ||
this.screenshotHelper = new ScreenshotHelper(log, conf.url, conf.chromiumPath, conf.ignoreHTTPSErrors); | ||
@@ -18,0 +18,0 @@ this.pendingSessions = {}; |
{ | ||
"name": "homebridge-website-to-camera", | ||
"version": "1.5.3", | ||
"version": "1.6.0", | ||
"description": "shows the screenshot of a website as camera (image)", | ||
@@ -43,4 +43,5 @@ "main": "index.js", | ||
"ip": "^1.1.5", | ||
"puppeteer-core": "3.0.1" | ||
"puppeteer-core": "^5.5.0", | ||
"username": "^5.1.0" | ||
} | ||
} |
@@ -10,2 +10,8 @@ # homebridge-website-to-camera | ||
If you find my work useful you can buy me a coffee, I am very thankful for your support. | ||
<a href="https://www.buymeacoffee.com/werthdavid" target="_blank"><img width="140" src="https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png" alt="Buy Me A Coffee"></a> | ||
# Installation | ||
@@ -58,2 +64,3 @@ | ||
* `renderTimeout` timeout in ms for waiting AFTER the page has loaded before taking the screenshot. userful for PWAs. (defaults to 1ms) | ||
* `ignoreHTTPSErrors` ignore HTTPS errors, useful for self-signed certificates (defaults to `false`) | ||
@@ -60,0 +67,0 @@ |
const puppeteer = require('puppeteer-core'); | ||
const username = require('username'); | ||
module.exports = ScreenshotHelper; | ||
function ScreenshotHelper(log, url, chromiumPath = "/usr/bin/chromium-browser") { | ||
function ScreenshotHelper(log, url, chromiumPath = "/usr/bin/chromium-browser", ignoreHTTPSErrors = false) { | ||
this.log = log; | ||
this.url = url; | ||
this.chromiumPath = chromiumPath; | ||
this.ignoreHTTPSErrors = ignoreHTTPSErrors; | ||
this.log("Initialized ScreenshotHelper"); | ||
@@ -19,2 +21,3 @@ } | ||
this.log("Starting new instance of Chromium: " + this.chromiumPath); | ||
const isRoot = username.sync() === "root"; | ||
this.browser = await puppeteer.launch( | ||
@@ -24,3 +27,4 @@ { | ||
headless: true, | ||
args: ['--no-sandbox'] // required if homebridge is started as root-user | ||
ignoreHTTPSErrors: this.ignoreHTTPSErrors, | ||
args: isRoot ? ['--no-sandbox'] : [] | ||
} | ||
@@ -27,0 +31,0 @@ ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1814211
345
80
3
+ Addedusername@^5.1.0
+ Added@types/node@22.9.3(transitive)
+ Addedcross-spawn@6.0.6(transitive)
+ Addeddevtools-protocol@0.0.818844(transitive)
+ Addedexeca@1.0.0(transitive)
+ Addedfind-up@4.1.0(transitive)
+ Addedget-stream@4.1.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedlocate-path@5.0.0(transitive)
+ Addedmap-age-cleaner@0.1.3(transitive)
+ Addedmem@4.3.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedp-defer@1.0.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-is-promise@2.1.0(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@4.1.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpkg-dir@4.2.0(transitive)
+ Addedpuppeteer-core@5.5.0(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedusername@5.1.0(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwhich@1.3.1(transitive)
- Removed@types/mime-types@2.1.4(transitive)
- Removed@types/node@22.9.1(transitive)
- Removedmime@2.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedpuppeteer-core@3.0.1(transitive)
Updatedpuppeteer-core@^5.5.0