File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11MIT License
22
3- Copyright (c) 2021 JustCoded
3+ Copyright (c) 2026 JustCoded
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change @@ -9,14 +9,47 @@ const server = prerender({
99 '--disable-gpu' ,
1010 '--remote-debugging-port=9222' ,
1111 '--hide-scrollbars' ,
12- '--disable-dev-shm-usage'
12+ '--disable-dev-shm-usage' ,
13+ '--ignore-certificate-errors' ,
14+ '--allow-insecure-localhost'
1315 ]
1416} ) ;
1517
1618process . env . CACHE_MAXSIZE = process . env . CACHE_MAXSIZE || 1000 ;
1719process . env . CACHE_TTL = process . env . CACHE_TTL || 43200 ;
1820
21+ server . use ( {
22+ tabCreated : ( req , res , next ) => {
23+ const tab = req . prerender . tab ;
24+
25+ if ( tab ) {
26+ tab . Console . enable ( ) ;
27+ tab . Network . enable ( ) ;
28+
29+ tab . Console . messageAdded ( ( params ) => {
30+ console . log ( '🟡 Browser log:' , params . message . text ) ;
31+ } ) ;
32+
33+ tab . Network . loadingFailed ( ( params ) => {
34+ console . log ( '🔴 Network Failed:' , params . errorText , params . url ) ;
35+ } ) ;
36+
37+ tab . Runtime . enable ( ) ;
38+ tab . Runtime . exceptionThrown ( ( exception ) => {
39+ console . log ( '💥 JS Exception:' , exception . exceptionDetails . text ) ;
40+ } ) ;
41+ }
42+
43+ next ( ) ;
44+ }
45+ } ) ;
46+
47+
48+
49+
50+ server . use ( prerender . removeScriptTags ( ) ) ;
51+
1952server . use ( memoryCache ) ;
2053
21- console . log ( 'Prerender on Node 24 is starting...' ) ;
22- server . start ( ) ;
54+ console . log ( 'Prerender on Node 24 starting...' ) ;
55+ server . start ( ) ;
You can’t perform that action at this time.
0 commit comments