Skip to content

Commit

Permalink
Replace deprecated call to browser.isConnected()
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Aug 27, 2024
1 parent e12a45c commit 0036a8c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
12 changes: 7 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ export default [
{
languageOptions: { parserOptions: { projectService: true } },
rules: {
'@typescript-eslint/no-confusing-void-expression': 'off', //prefer clean arrow functions
'@typescript-eslint/no-floating-promises': 'off', //annimations may be fire-and-forget
'@typescript-eslint/no-non-null-assertion': 'off', //ts cannot always discern if value exists
'@typescript-eslint/restrict-template-expressions': 'off', //numbers in templates are natural
'@typescript-eslint/unbound-method': 'off', //do not use 'this'
'@typescript-eslint/no-confusing-void-expression': 'off', //prefer minimal arrow functions
'@typescript-eslint/no-floating-promises': 'off', //annimations may be fire-and-forget
'@typescript-eslint/no-misused-promises': 'off', //annimations may be fire-and-forget
'@typescript-eslint/no-non-null-assertion': 'off', //ts cannot always know value exists
'@typescript-eslint/restrict-template-expressions': 'off', //numbers in templates are natural
'@typescript-eslint/unbound-method': 'off', //safer to not use 'this'
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off', //clarity over theoretical exceptions
},
},
];
2 changes: 1 addition & 1 deletion hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"jshint": "~2.13",
"puppeteer": "~23.0",
"puppeteer": "~23.2",
"puppeteer-browser-ready": "~1.3"
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@
"node-html-parser": "~6.1"
},
"devDependencies": {
"@eslint/js": "~9.8",
"@eslint/js": "~9.9",
"@types/express": "~4.17",
"@types/mocha": "~10.0",
"@types/node": "~22.1",
"@types/node": "~22.5",
"@types/ws": "~8.5",
"add-dist-header": "~1.4",
"assert-deep-strict-equal": "~1.2",
"copy-file-util": "~1.2",
"copy-folder-util": "~1.1",
"eslint": "~9.8",
"eslint": "~9.9",
"jshint": "~2.13",
"mocha": "~10.7",
"open": "~10.1",
"puppeteer": "~23.0",
"puppeteer": "~23.2",
"rimraf": "~6.0",
"run-scripts-util": "~1.3",
"typescript": "~5.5",
"typescript-eslint": "~8.0",
"typescript-eslint": "~8.3",
"w3c-html-validator": "~1.8"
}
}
4 changes: 2 additions & 2 deletions puppeteer-browser-ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const browserReady = {
const rootInfo = (root: HTMLElement) =>
`${root.constructor.name}/${root.firstChild?.toString().trim()}`;
const web = async (browser: Browser): Promise<Web> => {
log('Connected', browser.isConnected());
log('Connected', browser.connected);
try {
const page = await browser.newPage(); log('Page....', url);
const response = await page.goto(url); log('Response', response?.url());
Expand All @@ -100,7 +100,7 @@ const browserReady = {
return { browser, page, response, status, location, title, html, root };
}
catch (error) {
const status = browser.isConnected() ? 'connected' : 'not connected';
const status = browser.connected ? 'connected' : 'not connected';
console.log('[puppeteer-browser-ready]', settings, status);
console.log(error);
throw error;
Expand Down

0 comments on commit 0036a8c

Please sign in to comment.