Commit 3ac1de2 1 parent 13838b4 commit 3ac1de2 Copy full SHA for 3ac1de2
File tree 1 file changed +12
-16
lines changed
1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -36,23 +36,19 @@ class BrowserRunner {
36
36
37
37
await page . setRequestInterception ( true ) ;
38
38
39
- // only allow puppeteer to load necessary scripts needed for pre-rendering of the site itself
39
+ // only allow puppeteer to load necessary (local) scripts needed for pre-rendering of the site itself
40
40
page . on ( 'request' , interceptedRequest => {
41
- // const interceptedRequestUrl = interceptedRequest.url();
42
-
43
- // console.debug('request', interceptedRequestUrl);
44
- // TODO handle serialize only requests
45
- interceptedRequest . continue ( ) ;
46
- // if (
47
- // interceptedRequestUrl.indexOf('bundle.js') >= 0 || // webpack bundles, webcomponents-bundle.js
48
- // interceptedRequestUrl === requestUrl || // pages / routes
49
- // interceptedRequestUrl.indexOf('localhost:4000') >= 0 // Apollo GraphQL server
50
- // ) {
51
- // interceptedRequest.continue();
52
- // } else {
53
- // console.debug('aborting request', interceptedRequestUrl)
54
- // interceptedRequest.abort();
55
- // }
41
+ const interceptedRequestUrl = interceptedRequest . url ( ) ;
42
+
43
+ if (
44
+ interceptedRequestUrl . indexOf ( 'http://127.0.0.1' ) >= 0 ||
45
+ interceptedRequestUrl . indexOf ( 'localhost' ) >= 0
46
+ ) {
47
+ interceptedRequest . continue ( ) ;
48
+ } else {
49
+ // console.warn('aborting request', interceptedRequestUrl);
50
+ interceptedRequest . abort ( ) ;
51
+ }
56
52
} ) ;
57
53
58
54
try {
You can’t perform that action at this time.
0 commit comments