-
Is there any function like AddScriptToExecuteOnDocumentCreated() in WebView2 ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There are multiple ways to achieve that. So context is required. I am assuming that you will need that for some third party documents, if so then you should load such documents in <frame>s. In Sciter you can define That content.css may have this declaration:
Aspect in Sciter is a plain JS function that will be called once when matching element appears in the DOM and so users-content-handler.js may look like as:
That users-content-handler.js will be loaded as module into any document loaded into the frame and you can do whatever you want in that script. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response,
|
Beta Was this translation helpful? Give feedback.
There are multiple ways to achieve that. So context is required.
I am assuming that you will need that for some third party documents, if so then you should load such documents in <frame>s.
In Sciter you can define
<frame content-style="content.css" src="...">
. The frame is ordinary element similar to iframe in browsers - so it can appear in your root document (the one that is loaded into window directly).That content.css may have this declaration: