File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,6 @@ export const puppeteerRender = async (route: HandledRoute): Promise<string> => {
4141 /** set "running" mode */
4242 window [ 'ScullyIO' ] = 'running' ;
4343 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' ] ) ;
4944 window [ 'onCustomEvent' ] ( ) ;
5045 } ) ;
5146 } ) ;
@@ -54,6 +49,14 @@ export const puppeteerRender = async (route: HandledRoute): Promise<string> => {
5449 await page . goto ( path ) ;
5550
5651 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+ } ) ;
5760
5861 /**
5962 * The stange notation is needed bcs typescript messes
You can’t perform that action at this time.
0 commit comments