File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,6 @@ export const puppeteerRender = async (route: HandledRoute): Promise<string> => {
41
41
/** set "running" mode */
42
42
window [ 'ScullyIO' ] = 'running' ;
43
43
window . addEventListener ( 'AngularReady' , ( ) => {
44
- /** add a small script tag to set "generated" mode */
45
- const d = document . createElement ( 'script' ) ;
46
- d . innerHTML = `window['ScullyIO']='generated';` ;
47
- document . head . appendChild ( d ) ;
48
- document . body . setAttribute ( 'scully-version' , window [ 'scullyVersion' ] ) ;
49
44
window [ 'onCustomEvent' ] ( ) ;
50
45
} ) ;
51
46
} ) ;
@@ -54,6 +49,14 @@ export const puppeteerRender = async (route: HandledRoute): Promise<string> => {
54
49
await page . goto ( path ) ;
55
50
56
51
await Promise . race ( [ pageReady , waitForIt ( 25 * 1000 ) ] ) ;
52
+ await page . evaluate ( ( ) => {
53
+ /** add a small script tag to set "generated" mode */
54
+ const d = document . createElement ( 'script' ) ;
55
+ d . innerHTML = `window['ScullyIO']='generated';` ;
56
+ document . head . appendChild ( d ) ;
57
+ /** inject the scully version into the body attribute */
58
+ document . body . setAttribute ( 'scully-version' , window [ 'scullyVersion' ] ) ;
59
+ } ) ;
57
60
58
61
/**
59
62
* The stange notation is needed bcs typescript messes
You can’t perform that action at this time.
0 commit comments