As far as I could find, there is a way to reload the page using the following code in js.
location.reload()
But at the same time I found information that this method is not good.
Also, there might be a good code for typescript instead of js, or a cocos specific way, but I could not find it.
Could you please tell me what other methods are available?
I searched the documentation and found game.restart.
However, when I run it, I get the following error, which renders the editor inoperable
Do you have any information on this?
My version of CocosCreater is 3.8.2
[Window] this.callEditorPreviewMethod is not a function
TypeError: this.callEditorPreviewMethod is not a function
at PreviewClient.<anonymous> (C:\ProgramData\cocos\editors\Creator\3.8.2\resources\app.asar\builtin\scene\dist\engine-view\views\web \preview-client.ccc:1:4236)
at WebViewImpl.dispatchEventInMainWorld (electron/js2c/renderer_init.js:129:395)
at WebViewImpl.dispatchEvent (electron/js2c/renderer_init.js:133:2314)
at dispatchEvent (electron/js2c/renderer_init.js:121:770)
at EventEmitter.<anonymous> (electron/js2c/renderer_init.js:121:1784)
at EventEmitter.emit (events.js:315:20)
at Object.onMessage (electron/js2c/renderer_init.js:93:1117)