-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem/Bug]: Unable to execute/inject bulk script #4611
Comments
Could you show the smallest example which does not work? Is 30 lines do not work, but 29 lines works? |
Ok Let us try to narrow down the problem. I have a simple JS script as below:
I am executing the above using AddScriptToExecuteOnDocumentCreated function: Now I have a function to execute and get a return value which is already defined in the above executed code. Hope this data is enough, rather than worrying about javascript buffer size let me get a way to execute a function that is already been injected into webview2. |
Could you please try this approach - #4124 (comment) - if it will work for you |
@vbryh-msft , thanks for your response. Executing the bulky script on the first go is fine, but in the next script execution I need to get return value . Here I can't get the return value with synchronous call. That is my actual issue here! |
We have ExecuteScriptWithResult API - is it what you are looking for? |
Yes that is correct but that is what ExecuteScript with callback should do I suppose. Instead of such huge code with ExecuteScriptWithResult as below:
Why can't get we it working with ExecuteScript & callback as below:?
|
What happened?
I am trying to execute script of 3 different bigger javascript files on webview2 as a string buffer using ExecuteScript function as below:
With single line javascript execution, it is all fine. But when I try to execute bigger ones, I get null as return string.
I dont think string buffer limit might be an issue here.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
No response
Framework
Win32
Operating System
Windows 10
OS Version
No response
Repro steps
Actual Result : You will get null as a string
Expected Result : The Actual return value of a function
Repros in Edge Browser
Yes, issue can be reproduced in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: