File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,20 @@ import {IScopedQueryUtils} from './typedefs'
55// tslint:disable-next-line
66let Page , ElementHandle
77
8+ function requireOrUndefined ( path : string ) : any {
9+ try {
10+ return require ( path )
11+ } catch ( err ) { }
12+ }
13+
814try {
915 Page = require ( 'puppeteer/lib/Page.js' ) // tslint:disable-line
10- ElementHandle = require ( 'puppeteer/lib/ElementHandle.js' ) // tslint:disable-line
16+ if ( Page . Page ) Page = Page . Page
17+
18+ ElementHandle = requireOrUndefined ( 'puppeteer/lib/ElementHandle.js' ) // tslint:disable-line
19+ if ( ! ElementHandle ) {
20+ ElementHandle = require ( 'puppeteer/lib/ExecutionContext.js' ) . ElementHandle // tslint:disable-line
21+ }
1122
1223 Page . prototype . getDocument = getDocument
1324 getQueriesForElement ( ElementHandle . prototype , function ( this : ElementHandle ) : ElementHandle {
Original file line number Diff line number Diff line change 4848 "devDependencies" : {
4949 "@patrickhulce/lint" : " ^2.1.3" ,
5050 "@types/jest" : " ^23.1.1" ,
51- "@types/puppeteer" : " ^1.3.4 " ,
51+ "@types/puppeteer" : " ^1.10.0 " ,
5252 "generate-export-aliases" : " ^1.1.0" ,
5353 "jest" : " ^23.1.0" ,
54- "puppeteer" : " ^1.6 .0" ,
54+ "puppeteer" : " ^1.10 .0" ,
5555 "rollup" : " ^0.61.1" ,
5656 "rollup-plugin-commonjs" : " ^9.1.3" ,
5757 "rollup-plugin-node-resolve" : " ^3.3.0" ,
Original file line number Diff line number Diff line change 4646 resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
4747 integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
4848
49- " @types/events@* " :
50- version "1.2.0"
51- resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86"
52- integrity sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==
53-
5449" @types/jest@^23.1.1 " :
5550 version "23.1.1"
5651 resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.1.1.tgz#c54ab1a5f41aa693c0957222dd10414416d0c87b"
6156 resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.4.tgz#c74e8aec19e555df44609b8057311052a2c84d9e"
6257 integrity sha512-YMLlzdeNnAyLrQew39IFRkMacAR5BqKGIEei9ZjdHsIZtv+ZWKYTu1i7QJhetxQ9ReXx8w5f+cixdHZG3zgMQA==
6358
64- " @types/puppeteer@^1.3.4 " :
65- version "1.3.4 "
66- resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.3.4 .tgz#6fff43968792924ac2b68744641566e6acefdc20 "
67- integrity sha512-WI43+i2SZnYAm39ASmeDxhSR+czDIBuEqTNftg3V+bgTlqsbdmj8n/p9/95wWd4ipsnb/qD6nrvBekEvWh8UKQ ==
59+ " @types/puppeteer@^1.10.0 " :
60+ version "1.10.0 "
61+ resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.10.0 .tgz#15d5389d6d5ded7bfc0b06287e85655994f8badb "
62+ integrity sha512-qrDx+mdV3jj5GYVW9rh8upVt+Hu6xUKerOJE5ko7bSm3aagqKybhwSsQvLqaZJzNs0vbyvtX0wTgs/H/ZvORCA ==
6863 dependencies :
69- " @types/events" " *"
7064 " @types/node" " *"
7165
7266abab@^1.0.4 :
@@ -4346,10 +4340,10 @@ punycode@^2.1.0:
43464340 resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
43474341 integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
43484342
4349- puppeteer@^1.6 .0 :
4350- version "1.6 .0"
4351- resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.6 .0.tgz#b6b6bd6a063a0b7591258613ec89a135f2cf8f2e "
4352- integrity sha512-88epdIp3lw0LxI+sIHgdgZdq/u5zRnzgU2vJGvcyuGqHQrtRUeICTexTyT1KoKhTGG0mAKFRV9c7IJ179agm7A ==
4343+ puppeteer@^1.10 .0 :
4344+ version "1.10 .0"
4345+ resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.10 .0.tgz#e3005f1251c2feae0e10c0f7a35afbcd56589ceb "
4346+ integrity sha512-3i28X/ucX8t3eL4TZA60FLMOQNKqudFSOGDHr0cT7T4dE027CrcS885aAqjdxNybhMPliM5yImNsKJ6SQrPzhw ==
43534347 dependencies :
43544348 debug "^3.1.0"
43554349 extract-zip "^1.6.6"
You can’t perform that action at this time.
0 commit comments