File tree Expand file tree Collapse file tree 4 files changed +88
-1
lines changed Expand file tree Collapse file tree 4 files changed +88
-1
lines changed Original file line number Diff line number Diff line change 28
28
"homepage" : " https://github.com/sumanjs/suman-browser#readme" ,
29
29
"dependencies" : {
30
30
"async" : " ^2.5.0" ,
31
+ "chrome-launcher" : " ^0.10.2" ,
31
32
"lodash" : " ^4.17.4" ,
33
+ "puppeteer" : " ^1.0.0" ,
32
34
"replacestream" : " ^4.0.3" ,
33
- "suman-utils" : " 0.0.73121 " ,
35
+ "suman-utils" : " latest " ,
34
36
"webpack" : " ^3.8.1" ,
35
37
"webpack-stream" : " ^4.0.0"
36
38
},
Original file line number Diff line number Diff line change
1
+ // const puppeteer = require('puppeteer');
2
+ //
3
+ // (async function () {
4
+ //
5
+ // const b = await puppeteer.launch({
6
+ // devtools: true
7
+ // });
8
+ //
9
+ // const page = await b.newPage();
10
+ // await page.goto('https://example.com');
11
+ //
12
+ // })();
13
+
14
+
15
+ const util = require ( 'util' ) ;
16
+
17
+ const puppeteer = require ( 'puppeteer' ) ;
18
+
19
+ ( async ( ) => {
20
+
21
+
22
+ const args = puppeteer . defaultArgs ( ) . filter ( arg => String ( arg ) . toLowerCase ( ) !== '--disable-extensions' ) ;
23
+
24
+ const b = await puppeteer . launch ( {
25
+ headless : false ,
26
+ devtools : true ,
27
+ ignoreDefaultArgs : true ,
28
+ args : args . concat ( [ '--remote-debugging-port=9223' ] )
29
+ } ) ;
30
+
31
+ const browser = await puppeteer . connect ( {
32
+ browserWSEndpoint : b . wsEndpoint ( ) , //`ws://${host}:${port}/devtools/browser/<id>`,
33
+ ignoreHTTPSErrors : false
34
+ } ) ;
35
+
36
+ const page = await browser . newPage ( ) ;
37
+ await page . goto ( 'chrome-extension://hfnplgaapcnjblpebnhibfcdfllkpaaf/dist/index.html' ) ;
38
+
39
+
40
+ } ) ( ) ;
Original file line number Diff line number Diff line change
1
+ const cl = require ( 'chrome-launcher' ) ;
2
+ const util = require ( 'util' ) ;
3
+
4
+ cl . launch ( {
5
+ startingUrl : `http://yahoo.com` ,
6
+ chromeFlags : [ '--auto-open-devtools-for-tabs' , '--remote-debugging-port=9222' ] ,
7
+ enableExtensions : true
8
+ } )
9
+ . then ( c => {
10
+
11
+ console . log ( 'done' ) ;
12
+ console . log ( util . inspect ( c ) ) ;
13
+
14
+ } ) ;
Original file line number Diff line number Diff line change
1
+ const puppeteer = require ( 'puppeteer' ) ;
2
+
3
+ ( async ( ) => {
4
+
5
+ const args = puppeteer . defaultArgs ( ) . filter ( arg => String ( arg ) . toLowerCase ( ) !== '--disable-extensions' ) ;
6
+
7
+ const browser = await puppeteer . launch ( {
8
+ headless : false ,
9
+ devtools : true ,
10
+ ignoreDefaultArgs : true ,
11
+ args : args . concat ( [
12
+ '--remote-debugging-port=9223' ,
13
+ '--load-extension=/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-chrome-extension'
14
+ ]
15
+ )
16
+ } ) ;
17
+
18
+ const c = await puppeteer . connect ( {
19
+ browserWSEndpoint : browser . wsEndpoint ( ) , //`ws://${host}:${port}/devtools/browser/<id>`,
20
+ ignoreHTTPSErrors : false
21
+ } ) ;
22
+
23
+ const page = await c . newPage ( ) ;
24
+ await page . goto ( 'chrome-extension://hfnplgaapcnjblpebnhibfcdfllkpaaf/dist/index.html' ) ;
25
+
26
+ setTimeout ( async function ( ) {
27
+ const page = await c . newPage ( ) ;
28
+ await page . goto ( 'chrome-extension://hfnplgaapcnjblpebnhibfcdfllkpaaf/dist/index.html' ) ;
29
+ } , 3000 ) ;
30
+
31
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments