Comments (9)
Of coarse here is a test program showing the bug
extern crate web_view;
use web_view::WebView;
use web_view::MyUnique;
use web_view::Content;
use web_view::Dialog;
use web_view::Alert;
use web_view::run;
const HTML: &str = r#"
<DOCTYPE html>
<html>
<body>
<button onclick="window.external.invoke('open')">Open File Dialog</button>
<button onclick="window.external.invoke('save')">Save File Dialog</button>
<button onclick="window.external.invoke('directory')">Choose Directory Dialog</button>
<button onclick="window.external.invoke('alert-info')">Info Alert</button>
<button onclick="window.external.invoke('alert-warning')">Warning Alert</button>
<button onclick="window.external.invoke('alert-error')">Error Alert</button>
</body>
</html>
"#;
fn callback(view: &mut WebView<()>, arg: &str, user_data: &mut ()) {
match arg {
"open" => {
println!("Attempting to open 'OpenFile' dialog");
view.dialog(Dialog::OpenFile, "Test Open Dialog", "");
},
"save" => {
println!("Attempting to open 'SaveFile' dialog");
view.dialog(Dialog::SaveFile, "Test Open Dialog", "");
},
"directory" => {
println!("Attempting to open 'ChooseDirectory' dialog");
view.dialog(Dialog::ChooseDirectory, "Choose Directory Dialog", "");
},
"alert-info" => {
println!("Attempting to open info alert");
view.dialog(Dialog::Alert(Alert::Info), "Info Alert", "");
},
"alert-warning" => {
println!("Attempting to open warning alert");
view.dialog(Dialog::Alert(Alert::Warning), "Info Alert", "");
},
"alert-error" => {
println!("Attempting to open error alert");
view.dialog(Dialog::Alert(Alert::Error), "Info Alert", "");
}
_ => {}
}
}
fn main() {
let (_, _) = run("open dialog test",
Content::Html(HTML),
Some((500, 500)),
true,
true,
|_|{},
callback,
()
);
}
All of the alerts work so ignore those, but none of the file dialog's ever open
from web-view.
Not sure, I only have Win 8.1.
Do you have a minimal test example that exhibits the same behavior?
Maybe someone who also has Win 10 can test this..
from web-view.
This is the strangest thing, in order to debug this, I tried to put some debug prints into original c webview source code. With the printf statements in, everything works, when I comment them out, it does not work.
from web-view.
@Zxey I got fed up with Windows and installed Ubuntu at work so i no longer have the means to work on this.
After reading that I think it has something to do with building webview in the build script of the webview-sys crate. Maybe something isn't getting linked correctly? I am very new to C so maybe that's a stupid question. But if there is anything i can do to help debug let me know!
from web-view.
I found that that it does not work for me when i build webview in debug mode, but it works when i build it with release mode.
from web-view.
Seems like it is uninitialized variable in webview in c code.
from web-view.
Created PR in original webview library. Should be fixed when webview/webview#214 gets merged upstream. We can then update our submodule and get the fix.
from web-view.
Is the PR being merged already?
I can concur this problem still exist on windows 10
from web-view.
This also happens to me on Window 10, but only on the stable-msvc toolchain. Dialog functions normally when built on the stable-gnu toolchain.
nvm, still having the same problem.
from web-view.
Related Issues (20)
- Way to get current URL?
- Debug mode dumps HTML on every console message HOT 1
- Is there a ready event?
- Is this browser ready?
- Is there a way to access the true file system path when using a "Browse" button on webview?
- [Solved] Compilation fails with Edge feature enabled HOT 1
- Hovering over an image for alt text causes `NSException` on macOS 12.1 w/ M1
- Is multitouch supported? HOT 1
- Android? iOS?
- Make a fork and cooperate to maintain this crate! HOT 1
- box-shadow wrongly displayed
- iframe support?
- Corrupted files
- Is there a way to open two webview windows without crashing? HOT 1
- external.invoke returns undefined instead of promise on Windows 10 HOT 1
- Rust Webview JavaScript interface
- how to create handler? HOT 1
- Impossible to embed a local .js file to the .html code - it is simply not loaded HOT 1
- Blank page when running on X11 (but Wayland is ok)
- macos webview_cocoa.c unknown error
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 web-view.