File tree 3 files changed +22
-17
lines changed 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'
5
5
// tslint:disable-next-line
6
6
let Page , ElementHandle
7
7
8
+ function requireOrUndefined ( path : string ) : any {
9
+ try {
10
+ return require ( path )
11
+ } catch ( err ) { }
12
+ }
13
+
8
14
try {
9
15
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
+ }
11
22
12
23
Page . prototype . getDocument = getDocument
13
24
getQueriesForElement ( ElementHandle . prototype , function ( this : ElementHandle ) : ElementHandle {
Original file line number Diff line number Diff line change 48
48
"devDependencies" : {
49
49
"@patrickhulce/lint" : " ^2.1.3" ,
50
50
"@types/jest" : " ^23.1.1" ,
51
- "@types/puppeteer" : " ^1.3.4 " ,
51
+ "@types/puppeteer" : " ^1.10.0 " ,
52
52
"generate-export-aliases" : " ^1.1.0" ,
53
53
"jest" : " ^23.1.0" ,
54
- "puppeteer" : " ^1.6 .0" ,
54
+ "puppeteer" : " ^1.10 .0" ,
55
55
"rollup" : " ^0.61.1" ,
56
56
"rollup-plugin-commonjs" : " ^9.1.3" ,
57
57
"rollup-plugin-node-resolve" : " ^3.3.0" ,
Original file line number Diff line number Diff line change 46
46
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
47
47
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
48
48
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
-
54
49
" @types/jest@^23.1.1 " :
55
50
version "23.1.1"
56
51
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.1.1.tgz#c54ab1a5f41aa693c0957222dd10414416d0c87b"
61
56
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.4.tgz#c74e8aec19e555df44609b8057311052a2c84d9e"
62
57
integrity sha512-YMLlzdeNnAyLrQew39IFRkMacAR5BqKGIEei9ZjdHsIZtv+ZWKYTu1i7QJhetxQ9ReXx8w5f+cixdHZG3zgMQA==
63
58
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 ==
68
63
dependencies :
69
- " @types/events" " *"
70
64
" @types/node" " *"
71
65
72
66
abab@^1.0.4 :
@@ -4346,10 +4340,10 @@ punycode@^2.1.0:
4346
4340
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
4347
4341
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
4348
4342
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 ==
4353
4347
dependencies :
4354
4348
debug "^3.1.0"
4355
4349
extract-zip "^1.6.6"
You can’t perform that action at this time.
0 commit comments