You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// <Scripting>// Step 5 - Scripting// Schedule an async task to add initialization script that freezes the Object object
webview->AddScriptToExecuteOnDocumentCreated(L"Object.freeze(Object);", nullptr);
This line of javascript freezes the Object prototype, making it immutable. This causes any website which includes polyfills that extend the Object prototype to throw an error (and presumably not render anything). Polyfills are common place in web development. (More details MicrosoftEdge/WebView2Feedback#2035).
Is there a specific reason this sample recommends freezing the Object prototype?
The text was updated successfully, but these errors were encountered:
This code is just an example of injecting script, not a recommendation. I've opened a bug on our side to consider making the example more clear and less intrusive. Thanks!
The "most basic" sample Win32_GettingStarted includes this line
This line of javascript freezes the
Object
prototype, making it immutable. This causes any website which includes polyfills that extend theObject
prototype to throw an error (and presumably not render anything). Polyfills are common place in web development. (More details MicrosoftEdge/WebView2Feedback#2035).Is there a specific reason this sample recommends freezing the
Object
prototype?The text was updated successfully, but these errors were encountered: