Comments (8)
makes sense. want to provide a patch and test?
from cefsharp.
coming up. what kind of test?
from cefsharp.
if it's not a complete pain to set up then a couple of unit tests that RunScript behaves as expected for null/undefined and empty would be great
from cefsharp.
The big problem here is how to handle the exception/error path, without this we can't report errors to users. Unfortunately CEF is a little lacking here; Marshall suggested trying to watch for errors in the js console but this seems like quite a hack and would break if errors were sent to the console from within code. You're completely right that empty should be allowed though for cases with no return value. It is a shame that null and undefined are distinct from no value. I'm not sure what to do about this.
from cefsharp.
one crude solution would be to have separate api for running javascript that the caller expects to return a value and javascript that does not return a value.
RunScript();
RunScriptAndReturnObject();
i'm not a huge fan of this, though.
from cefsharp.
We could petition (or better still patch) Webkit to include a method which returns both the result and any exception that occurred, perhaps even along with a stack trace, err line no etc. if that's possible.
This would be far superior for both the success and error code paths.
from cefsharp.
n.b. this might not be feasible due to the several frames of WebFrameImpl between CEF and ScriptController
from cefsharp.
datapoint: both cocoa's WebView control and QT's QWebView control have a method that executes javascript and may return null (or equivalent) for both an execution failure or success.
from cefsharp.
Related Issues (20)
- EvaluateScriptAsync for SelfContained application
- RAM Leak HOT 1
- Frame identifiers changed from int64 to string
- CefSharp.PostMessage
- Get Web page cookies
- Page white screen
- Release Notification - 122.1.x
- Visual Content fails to load after upgrading from CEF Version 119.4.30 to CEF Version 120.1.80
- After updating to v122.1.120, disabling User Agent Client Hints using command line settings has stopped working HOT 1
- Nuget - Add repository to packages HOT 4
- Release Notification - 123.0.x
- CefSharp.BrowserSubprocess.exe crash when navigate to another url when I open CefSharp.Wpf.NetCore Demo HOT 1
- Can we have NetStandard compiled version of CefSharp.OffScreen ?
- when i enable "ChromeRuntime", the ChromiumWebBrowser layouts incorrect
- WinForm - 123.0.60 disable-gpu-compositing HOT 1
- Unable to get PostData from IRequest
- Release Notification - 124.3.x HOT 3
- OnRenderProcessTerminated add errorCode and errorMessage params
- IRenderWebBrowser.OnAcceleratedPaint pass in AcceleratedPaintInfo
- Remove Alloy Bootstrap HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cefsharp.