This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 22f23b59 Don't want status (log) messages
22f23b59 is described below
commit 22f23b598cf0a3801749ce4c25b84adc6e62b9b5
Author: Sebb <[email protected]>
AuthorDate: Mon Jul 14 23:49:47 2025 +0100
Don't want status (log) messages
---
tools/scan-page.js | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/scan-page.js b/tools/scan-page.js
index 4b65b83d..a6151ba3 100755
--- a/tools/scan-page.js
+++ b/tools/scan-page.js
@@ -37,9 +37,13 @@ function getHost(url) {
const browser = await puppeteer.launch({headless: "old", executablePath:
'/opt/google/chrome/chrome'});
const page = await browser.newPage();
await page.setRequestInterception(true);
- // capture CSP messages
- page.on('console', message =>
- console.log(`${message.type().toUpperCase()} ${message.text()}`))
+ // capture CSP messages (these are ERRORs)
+ page.on('console', message => {
+ let type = message.type().toUpperCase();
+ if (type != 'LOG') { // don't want logs
+ console.log(`${type} ${message.text()}`);
+ }
+ });
page.on('request', (interceptedRequest) => {
// already handled?
if (interceptedRequest.isInterceptResolutionHandled()) return;