profile
viewpoint
Jack Franklin jackfranklin @google London http://www.jackfranklin.co.uk JavaScript, React, ES2015+ and Elm.

aioutecism/amVim-for-VSCode 380

The Vim mode for Visual Studio Code(vscode) that works as expected.

asciidisco/grunt-requirejs 304

RequireJs (r.js) plugin for grunt.js

jackfranklin/angular-router-browserify 3

Angular's router module to be used with browserify.

jackfranklin/Base-Template 2

A starting point for all my development.

CodeHubOrg/JS-workshop-2015-resources 1

Material and links for JS workshop in Bristol 14 November 2015

jackfranklin/10KMemory 1

A word memory game for the 10k Apart competition.

push eventpuppeteer/puppeteer

Jack Franklin

commit sha e45acce928429d0d1572e16943307a73ebd38d8a

chore: run unit tests on node 10.15 + fix fs.promises access (#6550) * chore: run unit tests on node 10.15 We saw in https://github.com/puppeteer/puppeteer/issues/6548 that the `fs.promises` module was experimental in Node <10.17 and as such we introduced issues for users on 10.15. Until we can drop Node v10 (it's EOL is 30-04-20201 https://github.com/nodejs/Release#release-schedule) we should run our tests on an old Node 10 to avoid regressing in this area. * chore: helper for importing fs safely

view details

push time in 8 hours

delete branch puppeteer/puppeteer

delete branch : node-10-15

delete time in 8 hours

PR merged puppeteer/puppeteer

chore: run unit tests on node 10.15 + fix fs.promises access agnostification cla: yes

We saw in https://github.com/puppeteer/puppeteer/issues/6548 that the fs.promises module was experimental in Node <10.17 and as such we introduced issues for users on 10.15.

Until we can drop Node v10 (it's EOL is 30-04-20201 https://github.com/nodejs/Release#release-schedule) we should run our tests on an old Node 10 to avoid regressing in this area.

Closes #6548 .

+44 -7

2 comments

5 changed files

jackfranklin

pr closed time in 8 hours

issue closedpuppeteer/puppeteer

Compatible issue with node@10.13 - node@10.17

<!-- STEP 1: Are you in the right place?

  • For general technical questions or "how to" guidance, please search StackOverflow for questions tagged "puppeteer" or create a new post.

https://stackoverflow.com/questions/tagged/puppeteer

  • For issues or feature requests related to the DevTools Protocol (https://chromedevtools.github.io/devtools-protocol/), file an issue there:

https://github.com/ChromeDevTools/devtools-protocol/issues/new.

  • Problem in Headless Chrome? File an issue against Chromium's issue tracker:

https://bugs.chromium.org/p/chromium/issues/entry?components=Internals%3EHeadless&blocking=705916

For issues, feature requests, or setup troubles with Puppeteer, file an issue right here! -->

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 5.4.0
  • Platform / OS version: `macOS 10.15.17
  • URLs (if applicable):
  • Node.js version: 10.15.0

fs.promises is experimental in node@10.13 ~ node@10.17, so the result of Object.getOwnPropertyDescriptor(require('fs'), 'promises').enumerable is false, which means https://github.com/puppeteer/puppeteer/blob/main/src/common/helper.ts#L322 this line would throw Can not read property open from undefined

closed time in 8 hours

Brooooooklyn

PR closed puppeteer/puppeteer

Reviewers
fix(helper): access promises from raw 'fs' module cla: yes

Close https://github.com/puppeteer/puppeteer/issues/6548

+2 -2

1 comment

1 changed file

Brooooooklyn

pr closed time in 8 hours

pull request commentpuppeteer/puppeteer

fix(helper): access promises from raw 'fs' module

@Brooooooklyn thanks for your help here. I took your work and built on it a little and a fix will land in #6550 so I'm closing this.

Brooooooklyn

comment created time in 8 hours

push eventpuppeteer/puppeteer

Jack Franklin

commit sha d1ffcbd544aec513f235ced61cc720343170d649

chore: helper for importing fs safely

view details

push time in 8 hours

pull request commentpuppeteer/puppeteer

chore: run unit tests on node 10.15

@mathiasbynens PTAL at the latest commit. I took the work in #6549 but extracted it into a helper function that we can use in the mean time. That, plus running tests on Node 10.15, should ensure we don't hit this again.

jackfranklin

comment created time in 9 hours

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 377dd987f83107ae35f5b6a647e47b7d5e3d55f5

chore: helper for importing fs safely

view details

push time in 9 hours

pull request commentpuppeteer/puppeteer

chore: run unit tests on node 10.15

Note that I'm expecting the 10.15 CI run to fail, but hoping that I can then patch https://github.com/puppeteer/puppeteer/pull/6549 in and that will fix it.

jackfranklin

comment created time in 10 hours

create barnchpuppeteer/puppeteer

branch : node-10-15

created branch time in 10 hours

PR opened puppeteer/puppeteer

chore: run unit tests on node 10.15

We saw in https://github.com/puppeteer/puppeteer/issues/6548 that the fs.promises module was experimental in Node <10.17 and as such we introduced issues for users on 10.15.

Until we can drop Node v10 (it's EOL is 30-04-20201 https://github.com/nodejs/Release#release-schedule) we should run our tests on an old Node 10 to avoid regressing in this area.

+14 -1

0 comment

1 changed file

pr created time in 10 hours

issue commentpuppeteer/puppeteer

Compatible issue with node@10.13 - node@10.17

Ah, this is unfortunate. Our CI does run on 10.X but it runs on 10.19 so we managed to circumvent this problem.

I guess we can introduce a helper whilst we have to support <10.19 to ensure we get the import from the right place, #6549 looks like a good start, thanks!

Brooooooklyn

comment created time in 10 hours

PullRequestReviewEvent

Pull request review commentpuppeteer/puppeteer

fix: ignore spurious bindingCalled events

 export class DOMWorld {   private async _onBindingCalled(     event: Protocol.Runtime.BindingCalledEvent   ): Promise<void> {-    const { type, name, seq, args } = JSON.parse(event.payload);+    let payload: { type: string; name: string; seq: number; args: unknown[] };+    try {+      payload = JSON.parse(event.payload);+    } catch {+      // The binding was either called by something in the page or it was+      // called before our wrapper was initialized

just for my understanding: what might cause this? Just some code running before we set up our binding ?

johanbay

comment created time in 4 days

PullRequestReviewEvent

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 2458f8930cc004e3d169d3df2de02a5365c6d9f4

chore: swap to spec reporter

view details

push time in 4 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha e1adccf7810911068ef067688cccbd43c0be5b97

chore: upgrade mocha

view details

push time in 4 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha ce833e26a518b6f1bc94f7c10c8602ed205b0ed9

chore: enable mocha retries

view details

push time in 4 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 3d39422a9888ed217fe635008507ca308d06d3a4

chore: use list on ci only

view details

push time in 4 days

pull request commentpuppeteer/puppeteer

fix: do not use old utility world

@dmitrysteblyuk thanks for the ping, I'm investigating this now 👍

dmitrysteblyuk

comment created time in 4 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha c08b506107ff5fc26df761bc4a0ecd5eb188a7b3

chore: list all tests

view details

push time in 4 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 32fc4b8dcea2b9581f8826b0767a3affe6e54abd

chore: fix travis config

view details

push time in 4 days

PR opened puppeteer/puppeteer

chore: fix travis config
+16 -16

0 comment

1 changed file

pr created time in 4 days

create barnchpuppeteer/puppeteer

branch : travis-fixing

created branch time in 4 days

push eventjackfranklin/testing-react-with-jest

Jack Franklin

commit sha 17cf8adaccd295c6fb9d264491b75387f0d36b68

Updates plus prettier

view details

push time in 7 days

push eventjackfranklin/testing-react-with-jest

Jack Franklin

commit sha 57a372d7a8053122df69f4f139a0dd4b531956be

Upgrade everything to latest

view details

push time in 7 days

pull request commentpuppeteer/puppeteer

chore(agnostification): create `web` for web only code

How did you arrive at web and not browser? The latter seems more precise but I might be missing some context.

None really beyond I think we've talked about it as puppeteer-web and I named the entrypoint web.js. I don't have a strong feeling either way on which we should go but we should be consistent.

jackfranklin

comment created time in 7 days

pull request commentpuppeteer/puppeteer

chore(agnostification): create `web` for web only code

One thing I'd welcome opinions on: the two WebSocketTransport classes are almost identical bar the slight difference in how we create the socket (Node's ws lib vs browser) and in the types (one has private ws: NodeWebSocket and the other private ws: WebSocket).

That said, I cannot find a nice way to avoid the duplication in the code that doesn't 1) make it far more complex, 2) lose some type safety. That's why I've left the duplication as I think it's actually best (or least worst) compared to forcing an abstraction.

jackfranklin

comment created time in 7 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 1c3a977927c5cf61f72daa1c598325a4e1490a7e

chore(agnostification): create `web` for web only code This change makes a `web` folder to house any code that is just for the browser and won't work in a Node environment. We have three folders now to divide code up nicely: - `node` - `web` - `common`.

view details

push time in 7 days

PR opened puppeteer/puppeteer

chore(agnostification): create `web` for web only code

This change makes a web folder to house any code that is just for the browser and won't work in a Node environment.

We have three folders now to divide code up nicely:

  • node
  • web
  • common.
+16 -23

0 comment

6 changed files

pr created time in 7 days

create barnchpuppeteer/puppeteer

branch : tidy-up-browser

created branch time in 7 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha f63a123ecef86693e6457b07437a96f108f3e3c5

chore(agnostification): agnostify web socket connections (#6520) This PR updates the socket transport code to swap between a Node web socket transport or a web one based on the `isNode` environment. It also adds unit tests to the browser tests that show we can connect in a browser.

view details

push time in 7 days

delete branch puppeteer/puppeteer

delete branch : browser-socket-transport

delete time in 7 days

PR merged puppeteer/puppeteer

chore(agnostification): agnostify web socket connections agnostification cla: yes

This PR updates the socket transport code to swap between a Node web socket transport or a web one based on isNode. It also adds unit tests to the browser tests that show we can connect in a browser.

+151 -49

0 comment

7 changed files

jackfranklin

pr closed time in 7 days

Pull request review commentpuppeteer/puppeteer

chore(agnostification): agnostify web socket connections

 import { assert } from '../common/assert.js'; import { helper, debugError } from '../common/helper.js'; import { LaunchOptions } from './LaunchOptions.js'; import { Connection } from '../common/Connection.js';-import { WebSocketTransport } from '../common/WebSocketTransport.js';+import { NodeWebSocketTransport as WebSocketTransport } from '../node/NodeWebSocketTransport.js';

Yeah, I think so. Will rework in follow-up.

jackfranklin

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentpuppeteer/puppeteer

chore(agnostification): agnostify web socket connections

+/**+ * Copyright 2018 Google Inc. All rights reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ *     http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+import { ConnectionTransport } from './ConnectionTransport.js';++export class BrowserWebSocketTransport implements ConnectionTransport {+  static create(url: string): Promise<BrowserWebSocketTransport> {+    return new Promise((resolve, reject) => {+      const ws = new WebSocket(url);++      ws.addEventListener('open', () =>+        resolve(new BrowserWebSocketTransport(ws))+      );+      ws.addEventListener('error', reject);+    });+  }++  _ws: WebSocket;

Good catch

jackfranklin

comment created time in 7 days

PullRequestReviewEvent

push eventpuppeteer/puppeteer

Jack Franklin

commit sha c2c2bb7e558cc0dfd2a6a7976891131f68e5a2c9

chore(agnostification): common/helper.ts (#6515) * chore(agnostification): common/helper.ts The `readProtocolStream` method uses `fs` only if you want to write to a file. So we gate at the start of the function and ensure that if we got given a path we are not in a Node environment.

view details

Jack Franklin

commit sha 66ac8e2d0b42b67d446ef1d1f9ea747f425e07dd

chore(agnostification): agnostify web socket connections This PR updates the socket transport code to swap between a Node web socket transport or a web one based on the `isNode` environment. It also adds unit tests to the browser tests that show we can connect in a browser.

view details

push time in 7 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha c2c2bb7e558cc0dfd2a6a7976891131f68e5a2c9

chore(agnostification): common/helper.ts (#6515) * chore(agnostification): common/helper.ts The `readProtocolStream` method uses `fs` only if you want to write to a file. So we gate at the start of the function and ensure that if we got given a path we are not in a Node environment.

view details

push time in 7 days

delete branch puppeteer/puppeteer

delete branch : helper-agnostic

delete time in 7 days

PR merged puppeteer/puppeteer

chore(agnostification): common/helper.ts cla: yes

The readProtocolStream method uses fs only if you want to write to a file. So we gate at the start of the function and ensure that if we got given a path we are not in a Node environment.

We then use import('fs') to lazily load fs. We have multiple calls but they will be cached so I don't believe that it's going to be a perf hit.

+16 -5

0 comment

3 changed files

jackfranklin

pr closed time in 7 days

Pull request review commentpuppeteer/puppeteer

chore(agnostification): agnostify web socket connections

 export interface BrowserOptions {   slowMo?: number; } +const getWebSocketTransportClass = async () => {+  return isNode+    ? (await import('../node/NodeWebSocketTransport.js')).NodeWebSocketTransport+    : (await import('./BrowserWebSocketTransport.js'))

Yeah, I think probably there does. But then it'll get a bit messy with node/browser/common where common will sometimes conditionally load in things. But maybe that's fine?

I might leave this for a follow up PR - let me know if you feel strongly to fix this now 👍

jackfranklin

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentpuppeteer/puppeteer

chore(agnostification): common/helper.ts

 jobs:      - node_js: "12.16.3"       name: 'Browser tests: Linux/Chromium'+      addons:+        chrome: stable

@LarsDenBakker thanks! I'm quite keen to see if it's stable on a regular Chrome, but if not we'll reach for that and I expect I'll ping you for help :D

jackfranklin

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentpuppeteer/puppeteer

chore(agnostification): common/helper.ts

     "@types/ws": "^7.2.4",     "@typescript-eslint/eslint-plugin": "^4.4.0",     "@typescript-eslint/parser": "^4.4.0",-    "@web/test-runner": "^0.8.4",+    "@web/test-runner": "^0.9.2",

the old version started timing out on CI...upgrading to this fixes it. Not entirely sure why!

jackfranklin

comment created time in 10 days

PullRequestReviewEvent

Pull request review commentpuppeteer/puppeteer

chore(agnostification): common/helper.ts

 jobs:      - node_js: "12.16.3"       name: 'Browser tests: Linux/Chromium'+      addons:+        chrome: stable

needed to ensure Travis has an up to date chrome that web test runner can use

jackfranklin

comment created time in 10 days

PullRequestReviewEvent

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 7f241edc0aa8207181038c55fb2200200da4f048

chore: upgrade test-runner

view details

push time in 10 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha e84c224bddb4d685d5ef1feec5128d74041de3cb

chore: fix travis tests

view details

push time in 10 days

PR opened puppeteer/puppeteer

chore(agnostification): agnostify web socket connections

This PR updates the socket transport code to swap between a Node web socket transport or a web one based on the isNode environment. It also adds unit tests to the browser tests that show we can connect in a browser.

+135 -47

0 comment

8 changed files

pr created time in 10 days

create barnchpuppeteer/puppeteer

branch : browser-socket-transport

created branch time in 10 days

PullRequestReviewEvent

Pull request review commentpuppeteer/puppeteer

chore(agnostification): common/helper.ts

 async function readProtocolStream(   handle: string,   path?: string ): Promise<Buffer> {+  if (!isNode && path) {+    throw new Error('Cannot write to a path outside of Node.js environment.');+  }+

👍 PTAL!

jackfranklin

comment created time in 10 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha fe8f6cf8e9c1427cc94f3a9ba0b2fac071667a7d

chore(agnostification): common/helper.ts The `readProtocolStream` method uses `fs` only if you want to write to a file. So we gate at the start of the function and ensure that if we got given a path we are not in a Node environment. We then use `import('fs')` to lazily load fs. We have multiple calls but they will be cached so I don't believe that it's going to be a perf hit.

view details

push time in 10 days

Pull request review commentpuppeteer/puppeteer

chore(agnostification): common/helper.ts

 async function readProtocolStream(   handle: string,   path?: string ): Promise<Buffer> {+  if (!isNode && path) {+    throw new Error('Cannot write to a path outside of Node.js environment.');+  }+   let eof = false;-  let fileHandle: fs.promises.FileHandle;+  let fileHandle: import('fs').promises.FileHandle;

(this line doesn't make it into the compiled output)

jackfranklin

comment created time in 11 days

Pull request review commentpuppeteer/puppeteer

chore(agnostification): common/helper.ts

 async function readProtocolStream(   handle: string,   path?: string ): Promise<Buffer> {+  if (!isNode && path) {+    throw new Error('Cannot write to a path outside of Node.js environment.');+  }+   let eof = false;-  let fileHandle: fs.promises.FileHandle;+  let fileHandle: import('fs').promises.FileHandle;

No, because this is a type, so TS understands what we mean here. It's just so we can still type the fileHandle variable, but without an import * as fs... at the top of the file.

jackfranklin

comment created time in 11 days

PullRequestReviewEvent

PR opened puppeteer/puppeteer

chore(agnostification): common/helper.ts

The readProtocolStream method uses fs only if you want to write to a file. So we gate at the start of the function and ensure that if we got given a path we are not in a Node environment.

We then use import('fs') to lazily load fs. We have multiple calls but they will be cached so I don't believe that it's going to be a perf hit.

+11 -3

0 comment

1 changed file

pr created time in 11 days

create barnchpuppeteer/puppeteer

branch : helper-agnostic

created branch time in 11 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 637a1f740902aaa375713e5e29417e453e3f9b80

chore: gitignore new-docs (#6511) They are generating a lot of noise in PRs. This commit removes them from git, but updates CI to generate them - to ensure there are no errors when generating the new documentation. Further commits will: 1. Introduce linting to enforce methods are documented. 2. Generate previews of the new docs via GitHub actions or similar.

view details

push time in 12 days

delete branch puppeteer/puppeteer

delete branch : gitignore-new-docs

delete time in 12 days

PR merged puppeteer/puppeteer

chore: gitignore new-docs cla: yes

They are generating a lot of noise in PRs. This commit removes them from git, but updates CI to generate them - to ensure there are no errors when generating the new documentation.

Further commits will:

  1. Introduce linting to enforce methods are documented.
  2. Generate previews of the new docs via GitHub actions or similar.

Fixes #6507

+3 -66549

0 comment

4147 changed files

jackfranklin

pr closed time in 12 days

issue closedpuppeteer/puppeteer

Make reviewing of `new-docs` easier by marking them as binary.

The new-docs contains the generated output for the documentation website. However, this makes reading/reviewing PRs a bit more difficult, as a lot of it is "noise". Therefore, could the new-docs be marked as binary in the .gitattributes so that GitHub hides the diff?

If you still would want to review the new-docs output, a preview deployment GitHub action might be a good solution.

closed time in 12 days

TimvdLippe

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 26f1de63ea23adf4a69cad9cac9aa76322733bb6

chore: gitignore new-docs They are generating a lot of noise in PRs. This commit removes them from git, but updates CI to generate them - to ensure there are no errors when generating the new documentation. Further commits will: 1. Introduce linting to enforce methods are documented. 2. Generate previews of the new docs via GitHub actions or similar.

view details

push time in 12 days

PR opened puppeteer/puppeteer

chore: gitignore new-docs

They are generating a lot of noise in PRs. This commit removes them from git, but updates CI to generate them - to ensure there are no errors when generating the new documentation.

Further commits will:

  1. Introduce linting to enforce methods are documented.
  2. Generate previews of the new docs via GitHub actions or similar.

Fixes #6507

+3 -66549

0 comment

4147 changed files

pr created time in 13 days

create barnchpuppeteer/puppeteer

branch : gitignore-new-docs

created branch time in 13 days

delete branch puppeteer/puppeteer

delete branch : split-up-pptr-class

delete time in 13 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha e655bb6ca22e559ae95f3342a5ad5e954ce4649f

chore(agnostification): split up root Puppeteer class (#6504) The `Puppeteer` class had two concerns: * connect to an existing browser * launch a new browser The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the `Puppeteer` class apart into two: 1. `Puppeteer` which hosts the behaviour for connecting to existing browsers. 2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability to launch a new browser. This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a `PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause people any issues. We also now have new files that are effectively the entry points for Puppeteer: * `node.ts`: the main entry point for Puppeteer on Node. * `web.ts`: the main entry point for Puppeteer on the web. * `node-puppeteer-core.ts`: for those using puppeteer-core (which only exists in Node, not on the web).

view details

push time in 13 days

PR merged puppeteer/puppeteer

Reviewers
chore(agnostification): split up root Puppeteer class agnostification cla: yes

The Puppeteer class had two concerns:

  • connect to an existing browser
  • launch a new browser

The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the Puppeteer class apart into two:

  1. Puppeteer which hosts the behaviour for connecting to existing browsers.
  2. PuppeteerNode, which extends Puppeteer and also adds the ability to launch a new browser.

This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a PuppeteerNode rather than Puppeteer. I don't expect this to cause people any issues.

We also now have new files that are effectively the entry points for Puppeteer:

  • node.ts: the main entry point for Puppeteer on Node.
  • web.ts: the main entry point for Puppeteer on the web.
  • node-puppeteer-core.ts: for those using puppeteer-core (which only exists in Node, not on the web).
+549 -281

1 comment

36 changed files

jackfranklin

pr closed time in 13 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha c6ad6970527349c1bcf25e14e6df0f8e7b93942d

chore(agnostification): split up root Puppeteer class The `Puppeteer` class had two concerns: * connect to an existing browser * launch a new browser The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the `Puppeteer` class apart into two: 1. `Puppeteer` which hosts the behaviour for connecting to existing browsers. 2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability to launch a new browser. This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a `PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause people any issues. We also now have new files that are effectively the entry points for Puppeteer: * `node.ts`: the main entry point for Puppeteer on Node. * `web.ts`: the main entry point for Puppeteer on the web. * `node-puppeteer-core.ts`: for those using puppeteer-core (which only exists in Node, not on the web).

view details

push time in 13 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 3b515e49c399f7b1a1907d31995a9d24dd876c77

chore(agnostification): split up root Puppeteer class The `Puppeteer` class had two concerns: * connect to an existing browser * launch a new browser The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the `Puppeteer` class apart into two: 1. `Puppeteer` which hosts the behaviour for connecting to existing browsers. 2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability to launch a new browser. This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a `PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause people any issues. We also now have new files that are effectively the entry points for Puppeteer: * `node.ts`: the main entry point for Puppeteer on Node. * `web.ts`: the main entry point for Puppeteer on the web. * `node-puppeteer-core.ts`: for those using puppeteer-core (which only exists in Node, not on the web).

view details

push time in 13 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha dae61eb57861b468fb5af60356aaf869e4bd3753

chore(agnostification): split up root Puppeteer class The `Puppeteer` class had two concerns: * connect to an existing browser * launch a new browser The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the `Puppeteer` class apart into two: 1. `Puppeteer` which hosts the behaviour for connecting to existing browsers. 2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability to launch a new browser. This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a `PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause people any issues. We also now have new files that are effectively the entry points for Puppeteer: * `node.ts`: the main entry point for Puppeteer on Node. * `web.ts`: the main entry point for Puppeteer on the web. * `node-puppeteer-core.ts`: for those using puppeteer-core (which only exists in Node, not on the web).

view details

push time in 13 days

issue commentpuppeteer/puppeteer

Make reviewing of `new-docs` easier by marking them as binary.

The main thing I wanted to achieve with having them in the repo was to ensure that as people worked they didn't introduce any bugs/issues with the documentation. e.g. for each change, I wanted to force that the new-docs were able to be generated successfully and the diff looked reasonable.

What about if we:

  1. gitignore the new-docs folder
  2. Ensure on CI for each PR that the docs get generated successfully
  3. Try to add linting or something to ensure all new code is documented via the TSDoc comments
  4. Add a GitHub preview deploy to each PR

And that way we'd still ensure the docs are in a good state but avoid the diff noise on each PR.

WDYT?

TimvdLippe

comment created time in 13 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha d318cf45f11d062b9979ea4cf0f10fd46c2bfa86

chore(agnostification): split up root Puppeteer class The `Puppeteer` class had two concerns: * connect to an existing browser * launch a new browser The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the `Puppeteer` class apart into two: 1. `Puppeteer` which hosts the behaviour for connecting to existing browsers. 2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability to launch a new browser. This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a `PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause people any issues. We also now have new files that are effectively the entry points for Puppeteer: * `node.ts`: the main entry point for Puppeteer on Node. * `web.ts`: the main entry point for Puppeteer on the web. * `node-puppeteer-core.ts`: for those using puppeteer-core (which only exists in Node, not on the web).

view details

push time in 14 days

pull request commentpuppeteer/puppeteer

Proposal: fetch elements within shadow root with `shadow$` and `shadow$$`

@mathiasbynens is this PR still useful? Or is the work than @johanbay has been doing now going to enable this more easily?

christian-bromann

comment created time in 14 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha f04bec5a15c4c766e1c9f9b1b5020896ffb10a36

chore: update eslint & eslint plugins (#6487) Updates ESLint, the TypeScript ESLint plugins, and updates code where the rules have changed.

view details

Jack Franklin

commit sha f6107c82581181e7e0cf052362f3322b1b2f463e

chore(agnostification): split up root Puppeteer class The `Puppeteer` class had two concerns: * connect to an existing browser * launch a new browser The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the `Puppeteer` class apart into two: 1. `Puppeteer` which hosts the behaviour for connecting to existing browsers. 2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability to launch a new browser. This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a `PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause people any issues. We also now have new files that are effectively the entry points for Puppeteer: * `node.ts`: the main entry point for Puppeteer on Node. * `web.ts`: the main entry point for Puppeteer on the web. * `node-puppeteer-core.ts`: for those using puppeteer-core (which only exists in Node, not on the web).

view details

push time in 14 days

pull request commentpuppeteer/puppeteer

chore(agnostification): split up root Puppeteer class

Puppeteer Node vs Browser entry points

I drew this diagram as it might help visualise the entry points for each environment.

jackfranklin

comment created time in 14 days

PR opened puppeteer/puppeteer

chore(agnostification): split up root Puppeteer class

The Puppeteer class had two concerns:

  • connect to an existing browser
  • launch a new browser

The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the Puppeteer class apart into two:

  1. Puppeteer which hosts the behaviour for connecting to existing browsers.
  2. PuppeteerNode, which extends Puppeteer and also adds the ability to launch a new browser.

This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a PuppeteerNode rather than Puppeteer. I don't expect this to cause people any issues.

We also now have new files that are effectively the entry points for Puppeteer:

  • node.ts: the main entry point for Puppeteer on Node.
  • web.ts: the main entry point for Puppeteer on the web.
  • node-puppeteer-core.ts: for those using puppeteer-core (which only exists in Node, not on the web).
+535 -288

0 comment

35 changed files

pr created time in 14 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 907f82e68cc08beec4537abbe3087536dd88f668

chore(agnostification): split up root Puppeteer class The `Puppeteer` class had two concerns: * connect to an existing browser * launch a new browser The first of those concerns is needed in all environments, but the second is only needed in Node. https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to pull the `Puppeteer` class apart into two: 1. `Puppeteer` which hosts the behaviour for connecting to existing browsers. 2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability to launch a new browser. This is a non-breaking change, because Node users will still get an instance of a class with all the methods they expect, but it'll be a `PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause people any issues. We also now have new files that are effectively the entry points for Puppeteer: * `node.ts`: the main entry point for Puppeteer on Node. * `web.ts`: the main entry point for Puppeteer on the web. * `node-puppeteer-core.ts`: for those using puppeteer-core (which only exists in Node, not on the web).

view details

push time in 14 days

create barnchpuppeteer/puppeteer

branch : split-up-pptr-class

created branch time in 14 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha f04bec5a15c4c766e1c9f9b1b5020896ffb10a36

chore: update eslint & eslint plugins (#6487) Updates ESLint, the TypeScript ESLint plugins, and updates code where the rules have changed.

view details

push time in 14 days

delete branch puppeteer/puppeteer

delete branch : eslint-updates

delete time in 14 days

PR merged puppeteer/puppeteer

Reviewers
chore: update eslint & eslint plugins cla: yes

Updates ESLint, the TypeScript ESLint plugins, and updates code where the rules have changed.

+245 -204

1 comment

19 changed files

jackfranklin

pr closed time in 14 days

push eventpuppeteer/puppeteer

Tim van der Lippe

commit sha 1ed38af79abbe75038fabdae6d3fbb1ea2bf7a47

chore(node): move install.ts into node/ (#6490) This file contains logic that is unique to the Node.js environment and therefore should be moved into the `node` sub-folder.

view details

Jack Franklin

commit sha 4846b8723cf20d3551c0d755df394cc5e0c82a94

chore(agnostification): split up launcher class (#6484) The `Launcher` class was serving two purposes: 1. Launch browsers 2. Connect to browsers Number 1) only needs to be done in Node land, but 2) is agnostic; in a browser version of Puppeteer we'll need the ability to connect over a websocket to send commands back and forth. As part of the agnostification work we needed to split the `Launcher` up so that the connection part can be made agnostic. Additionally, I removed dependencies on `https`, `http` and `URL` from Node, instead leaning on fetch (via `node-fetch` if in Node land) and the browser `URL` API (which was added to Node in Node 10).

view details

Jack Franklin

commit sha 726c90f129092b8835341b3143d33cb6fa7b1593

chore: update eslint & eslint plugins Updates ESLint, the TypeScript ESLint plugins, and updates code where the rules have changed.

view details

push time in 14 days

create barnchpuppeteer/puppeteer

branch : update-misc-deps

created branch time in 14 days

pull request commentpuppeteer/puppeteer

Add param `threshold` to `isIntersectingViewport`

I quite like this change. I wonder about the API being { threshold: X } (so it's self-documenting & easy to add more options in future).

@mathiasbynens wdyt about this?

ron0115

comment created time in 14 days

Pull request review commentpuppeteer/puppeteer

fix executablePath (arm64)

 function downloadURL( function handleArm64(): void {   fs.stat('/usr/bin/chromium-browser', function (err, stats) {     if (stats === undefined) {-      console.error(`The chromium binary is not available for arm64: `);-      console.error(`If you are on Ubuntu, you can install with: `);-      console.error(`\n apt-get install chromium-browser\n`);-      throw new Error();+      fs.stat('/usr/bin/chromium', function (err, stats) {

(I'm not familiar with arm64) why would it maybe be in chromium-browser or chromium? Should we update the error message too?

alex2844

comment created time in 14 days

PullRequestReviewEvent

push eventpuppeteer/puppeteer

Jack Franklin

commit sha 4846b8723cf20d3551c0d755df394cc5e0c82a94

chore(agnostification): split up launcher class (#6484) The `Launcher` class was serving two purposes: 1. Launch browsers 2. Connect to browsers Number 1) only needs to be done in Node land, but 2) is agnostic; in a browser version of Puppeteer we'll need the ability to connect over a websocket to send commands back and forth. As part of the agnostification work we needed to split the `Launcher` up so that the connection part can be made agnostic. Additionally, I removed dependencies on `https`, `http` and `URL` from Node, instead leaning on fetch (via `node-fetch` if in Node land) and the browser `URL` API (which was added to Node in Node 10).

view details

push time in 14 days

delete branch puppeteer/puppeteer

delete branch : pull-apart-launcher

delete time in 14 days

PR merged puppeteer/puppeteer

chore(agnostification): split up launcher class cla: yes

The Launcher class was serving two purposes:

  1. Launch browsers
  2. Connect to browsers

Number 1) only needs to be done in Node land, but 2) is agnostic; in a browser version of Puppeteer we'll need the ability to connect over a websocket to send commands back and forth.

As part of the agnostification work we needed to split the Launcher up so that the connection part can be made agnostic. Additionally, I removed dependencies on https, http and URL from Node, instead leaning on fetch (via node-fetch if in Node land) and the browser URL API (which was added to Node in Node 10).

+180 -221

1 comment

15 changed files

jackfranklin

pr closed time in 14 days

push eventpuppeteer/puppeteer

Mathias Bynens

commit sha 936ccdca2c215068491a0d8d207ad3bf279a36ce

chore: enforce Conventional Commits through commitlint (#6483) This patch sets up commitlint to enforce the Conventional Commits format. This check runs with the other lint checks as part of npm run lint, and a Git commit hook is set up via Husky for automated local checks. Issue: #6482

view details

Jack Franklin

commit sha e94a1e87dc65fcb83e9e2bb49ebaeec2f04fb399

chore: bump misc dependencies (#6488) This commit updates some miscellaneous dependencies to their latest versions (with no other changes required) and also removes the `browser` section, which was used by Browserify for the now long gone Puppeteer-Web package that we used to publish.

view details

Jack Franklin

commit sha ae2452b89134993c6f1001330128f72c81c6c7c3

chore(agnostification): split up launcher class The `Launcher` class was serving two purposes: 1. Launch browsers 2. Connect to browsers Number 1) only needs to be done in Node land, but 2) is agnostic; in a browser version of Puppeteer we'll need the ability to connect over a websocket to send commands back and forth. As part of the agnostification work we needed to split the `Launcher` up so that the connection part can be made agnostic. Additionally, I removed dependencies on `https`, `http` and `URL` from Node, instead leaning on fetch (via `node-fetch` if in Node land) and the browser `URL` API (which was added to Node in Node 10).

view details

push time in 18 days

push eventpuppeteer/puppeteer

Jack Franklin

commit sha e94a1e87dc65fcb83e9e2bb49ebaeec2f04fb399

chore: bump misc dependencies (#6488) This commit updates some miscellaneous dependencies to their latest versions (with no other changes required) and also removes the `browser` section, which was used by Browserify for the now long gone Puppeteer-Web package that we used to publish.

view details

Jack Franklin

commit sha ff106c0c8f82e0f682af144c4b05646bff3abad7

chore: update eslint & eslint plugins Updates ESLint, the TypeScript ESLint plugins, and updates code where the rules have changed.

view details

push time in 18 days

push eventpuppeteer/puppeteer

Mathias Bynens

commit sha 936ccdca2c215068491a0d8d207ad3bf279a36ce

chore: enforce Conventional Commits through commitlint (#6483) This patch sets up commitlint to enforce the Conventional Commits format. This check runs with the other lint checks as part of npm run lint, and a Git commit hook is set up via Husky for automated local checks. Issue: #6482

view details

Jack Franklin

commit sha 9c77661c327bb2b35abcbda962d9378dbb6080e9

chore: update eslint & eslint plugins Updates ESLint, the TypeScript ESLint plugins, and updates code where the rules have changed.

view details

push time in 18 days

PullRequestReviewEvent

delete branch puppeteer/puppeteer

delete branch : update-misc-deps

delete time in 18 days

more