Coder Social home page Coder Social logo

boscop / web-view Goto Github PK

View Code? Open in Web Editor NEW
1.9K 1.9K 174.0 1.2 MB

Rust bindings for webview, a tiny cross-platform library to render web-based GUIs for desktop applications

License: MIT License

Rust 18.07% C 16.16% C++ 4.04% HTML 23.65% CSS 2.94% JavaScript 32.70% Elm 0.93% PureScript 0.68% Vue 0.77% Makefile 0.05%

web-view's Introduction

web-view   .github/workflows/ci.yml Latest Version

Important: requires Rust 1.30 stable or newer.

This library provides a Rust binding to the original implementation of webview, a tiny cross-platform library to render web-based GUIs as desktop applications.

screenshot

Two-way binding between your Rust and JavaScript code is made simple via the external JS object and webview.eval Rust function. We have full working examples, but the core is as follows:

// ... Simplified for the sake of brevity.
web_view::builder()    
    .invoke_handler(|webview, arg| {
        match arg {
            "test_one" => {
                // Do something in Rust!
            }
            "test_two" => {
                // Invoke a JavaScript function!
                webview.eval(&format!("myFunction({}, {})", 123, 456))
            }
            _ => unimplemented!(),
        };
    })
// Executes our "invoke_handler" - passing the value "test_one" as the second parameter.
external.invoke('test_one');

// Executes our "invoke_handler", which in turn calls "myFunction" below.
external.invoke('test_two');

function myFunction(paramOne, paramTwo) {
    console.log(paramOne);
    console.log(paramTwo);
}

In addition, by relying on the default rendering engine of the host Operating System, you should be met with a significantly leaner binary to distribute compared to alternatives such as Electron which have to bundle Chromium with each distribution.

You should also see comparatively less memory usage, and this section will be updated with benchmarks to highlight this in due course.

Finally, the supported platforms and the engines you can expect to render your application content are as follows:

Operating System Browser Engine Used
Windows MSHTML or EdgeHTML
Linux Gtk-webkit2
OSX Cocoa/WebKit

Note: by default the MSHTML (IE) rendering engine is used to display the application on Windows. If you want to make use of EdgeHTML (Edge) then you'll need to enable it with a feature switch (see the installation and configuration section).

Prerequisites

If you're planning on targeting Linux you must ensure that Webkit2gtk is already installed and available for discovery via the pkg-config command.

If you skip this step you will see a similarly formatted error message as below informing you of what's missing:

Compiling webview-sys v0.3.3
error: failed to run custom build command for `webview-sys v0.3.3`
Caused by:
process didn't exit successfully: `/home/username/rust-projects/my-project/target/debug/build/webview-sys-9020ddaf41e4df7d/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"webkit2gtk-4.0\" \"webkit2gtk-4.0 >= 2.8\"", cause: Os { code: 2, kind: NotFound, message: "No such file or directory" } }', src/libcore/result.rs:1165:5

Installation and Configuration

Let's start off with the basic Rust application. Run cargo new my-project in a shell of your choice and change into the my-project directory.

As this library can be found as a crate on the Rust Community Registry all you have to do to add this as a dependency is update your Cargo.toml file to have the following under its dependencies section:

[dependencies]
web-view = { version = "0.7" }

If you want to make use of Edge on Windows environments, you will need to have Windows 10 SDK installed through Visual Studio Installer and you'll need to use the following syntax instead:

[dependencies]
web-view = { version = "0.7", features = ["edge"] }

Now let's write some Rust code that makes use of the library. Open up the main.rs file in an editor of your choice:

vim src/main.rs

And replace the contents with the following:

use web_view::*;

fn main() {
    let html_content = "<html><body><h1>Hello, World!</h1></body></html>";
	
    web_view::builder()
        .title("My Project")
        .content(Content::Html(html_content))
        .size(320, 480)
        .resizable(false)
        .debug(true)
        .user_data(())
        .invoke_handler(|_webview, _arg| Ok(()))
        .run()
        .unwrap();
}

You should now be able to run cargo build and see something similar to the output below:

$ cargo build
Updating crates.io index
Compiling pkg-config v0.3.17
Compiling cc v1.0.47
Compiling boxfnonce v0.1.1
Compiling urlencoding v1.0.0
Compiling webview-sys v0.3.3
Compiling web-view v0.5.4
Compiling my-project v0.1.0 (C:\Users\Username\source\rust-projects\my-project)
Finished dev [unoptimized + debuginfo] target(s) in 8.36s

Assuming you get a successful build all you have to do now is run it with: cargo run. Hopefully you'll see the same as below:

screenshot

For more usage info please check out the examples and the original README.

Known Issues and Limitations

  • Edge feature switch not working on Windows 10 if run as Administrator. This was the root cause of the issue raised in #96 and is the result of a bug in Microsoft.Toolkit.Win32 which is tracked here.

  • Edge sandbox restrictions. If you decide to make use of an embedded Web Server to return your content you will need to run the following command to bypass the restriction that prevents communication with localhost:

    $ # Requires administrative privileges.
    $ CheckNetIsolation.exe LoopbackExempt -a -n="Microsoft.Win32WebViewHost_cw5n1h2txyewy"

    This is usually used with Windows IoT Core, when allowing TCP/IP connections between two processes. You can read some more about this in the Microsoft Documentation here.

  • IE rendering content in a legacy, compatibility format. By default, content rendered inside a Web Browser Control will be done so in compatibility mode (specifically IE7). To get round this on Windows systems where Edge is not available you can force the use of the highest version of IE installed via a Registry tweak.

Suggestions

  • If you like type safety, write your frontend in Elm or PureScript*, or use a Rust frontend framework that compiles to asm.js, like yew.
  • Use parcel to bundle & minify your frontend code.
  • Use inline-assets to inline all your assets (css, js, html) into one index.html file and embed it in your Rust app using include_str!().
  • If your app runs on windows, add an icon to your Rust executable to make it look more professional™
  • Use custom npm scripts or just or cargo-make to automate the build steps.
  • Make your app state persistent between sessions using localStorage in the frontend or rustbreak in the backend.
  • Btw, instead of injecting app resources via the js api, you can also serve them from a local http server (e.g. bound to an ephemeral port).
  • Happy coding :)

* The free PureScript By Example book contains several practical projects for PureScript beginners.

Contribution opportunities

  • Create an issue for any question you have
  • Docs
  • Feedback on this library's API and code
  • Test it on non-windows platforms, report any issues you find
  • Showcase your app
  • Add an example that uses Elm or Rust compiled to asm.js
  • Add a PureScript example that does two-way communication with the backend
  • Contribute to the original webview library: E.g. add HDPI support on Windows
  • Make it possible to create the webview window as a child window of a given parent window. This would allow webview to be used for the GUIs of VST audio plugins in Rust.

Ideas for apps

  • Rust IDE (by porting xi-electron to web-view)
  • Data visualization / plotting lib for Rust, to make Rust more useful for data science
  • Crypto coin wallet
  • IRC client, or client for other chat protocols
  • Midi song editor, VJ controller
  • Rust project template wizard: Generate new Rust projects from templates with user-friendly steps
  • GUI for pijul
  • Implement Gooey alternative with web-view and clap-rs

Showcase

Feel free to open a PR if you want your project to be listed here!

  • Juggernaut - The unstoppable programmers editor
  • FrakeGPS - Simulate a simple GPS device
  • Compactor - Windows 10 filesystem compression utility
  • neutrino - A GUI frontend in Rust based on web-view
  • SOUNDSENSE-RS - Sound-engine tool for Dwarf Fortress
  • WV Linewise - Add your own interactive HTML/CSS/JS in the middle of your UNIX pipelines
  • Bloop - A light weight aesthetic scratchpad for developers.

Contributions and feedback welcome :)


web-view's People

Contributors

3442853561 avatar aatxe avatar blakeinstein avatar blckngm avatar boscop avatar carbotaniuman avatar daemontus avatar dependabot[bot] avatar doctorvwa avatar emulator000 avatar forbesmyester avatar freaky avatar freemasen avatar gin66 avatar giopat avatar green-s avatar michaelsearson avatar nothingismagick avatar parkovski avatar pzmarzly avatar quadrupleslap avatar rajivshah3 avatar regentag avatar richardhozak avatar sergejjurecko avatar svenpaulsen avatar t-hacker avatar wezm avatar zec avatar zxey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-view's Issues

Change URL of webview?

Once I have a web view built and displayed, if i need to change the URL, how would I do that? I tried eval'ing window.location.href = '' and that didn't seem to do anything. Thanks.

Use Custom version of zserge/webview

I've been using web-view for a while now, and i have to use a custom version of zserge/webview. Since i use your bindings i would also have to maintain web-view & web-view-sys crates. It would be interesting if there was a way to specify a fork of the webview repository for use instead of zserge/webview@master. I have no idea how this could work but i imagine since webview is a new library lot's of people might find themselves needing to use a custom webview repo. If you have any idea's on how this could be implemented I'd be willing to work on it and submit a PR.

EdgeHTML Support

As for MSHTML vs EdgeHTML, I would like to keep MSHTML for as long as possible and create EdgeHTML alongside that which can be enabled with feature flag. The reason is that Rust supports Windows 7 and newer (AFAIK) and EdgeHTML supports Windows 10 only.

Originally posted by @Zxey in #64 (comment)

While Rust does only have Tier 1 support Win7+, post-MSHTML support is a necessity for WASM. As noted by this repo's issue tracker, WASM support is highly desired.

RPC from elm/yew

How do you make an RPC call between the rust code and elm or yew frontend code? The elm example doesn't show this, and as far as I can tell it's not possible to call window.external.invoke from either of these libraries.

Question: Is it possible to update the HTML being displayed?

Please excuse me if it's faux pas to ask a question in issues.

The way I'm using web-view is reading a few files, building a html-table and feeding that to web-view with

    let size = (900, 778);
    let resizable = false;
    let debug = true;
    let init_cb = |_webview| {};
    let frontend_cb = |_webview: &mut _, _arg: &_, _userdata: &mut _| {};
    let userdata = ();
    run(
        "WR-stats",
        Content::Html(html),
        Some(size),
        resizable,
        debug,
        init_cb,
        frontend_cb,
        userdata,
    );

Eventually I want to listen for changes in a file, and if there are reread that file and rebuild the html. Is it possible to simply swap out the html being displayed with this new rebuilt html?

Error compiling webview-sys on Linux

A friend of mine tried to compile my app which uses webview, on Linux, but ran into the following error message:

If there is any additional information that would be helpful, please let me know.

Detail examples usage a bit more

Hey, hello and thank you very much for this great effor.
I would love to try this project examples, but the documentation for doing it is very laky. There is just one reference to cargo run but nothing else.
This may be trivial for rust developers, but as a Javascript developer it leaves me in the dark.
If you make some better instructions (and potentially build instructions too) you will probably gain a lot of traction on JS community.

Thanks and regards.

crates.io + &'str

The version on Crates.io doesn't have your builder pattern.

I also tried using the crates.io version and it seems to work nicely (until you make huge Strings to send to the UI :/).
The UI doesn't look nice though but it was really meant to be a proof of concept so I was just more interested in showing how to send data from Rust to Elm and vice-versa. If you want to use anything for an example you're more than welcome to.

Can't retrieve user_data on MacOS

Hi! I'm not sure if this is a limitation of the underlying webview library or something in the Rust bindings, but perhaps you have some input on this.

Running this sample program here:

use web_view::*;

fn main() {
  let res = web_view::builder()
      .title("Page load example")
      .content(Content::Html(HTML))
      .size(800, 600)
      .resizable(true)
      .debug(true)
      .user_data("data")
      .invoke_handler(|_webview, _arg| Ok(()))
      .run()
      .unwrap();

  eprintln!("res: {}", res);
}

const HTML: &str = r#"
<!doctype html>
<html>
	<body>
	  <h1>Hello, world</h1>
	</body>
</html>
"#;

On Linux, I'll get the "res: data" on the console. On MacOS, however, the program terminates with the call to webview_terminate() and never reaches the point where the returned user data can be used.

Any idea why that is or how one could work around this?

Webkit issue

I'm using Linux.
When I try to run the minimal example, the Wikipedia page loads. But when I right click on it and select "Inspect", an error appears instead of the inspector :
Screenshot_20190929_190106
Actually I am asking this question here because I am using web-view in my own crate (neutrino) and it does the same thing...
Another people using Linux got the same issue

App crashes on gcc compile.

The lib compiled right but when it start compilling the application it gives me that error:

error: linking with `gcc` failed: exit code: 1
  |
  = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl, --nxcompat" "-nostdlib" "-m64" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord0.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord1.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord10.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord11.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord12.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord13.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord14.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord15.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord2.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord3.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord4.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord5.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord6.rcgu.o"
 "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord15cb8e6d8b51a027.lilcord7.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord8.rcgu.o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.lilcord9.rcgu.o" "-o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.exe" "-Wl,--subsystem,windows" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\lilcord-15cb8e6d8b51a027.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L"
"C:\\msys64\\mingw64\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\Users\\DoctorVWA\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\winapi-x86_64-pc-windows-gnu-0.4.0\\lib" "-L" "C:\\msys64\\mingw64\\lib" "-L" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\build\\web-view-118842cd41122d28\\out" "-L" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libgtk-4f6e228c353d35d0.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libgdk-fcb647845b415b3b.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libpango-483712774c188bf6.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libgdk_pixbu
f-9aa85792949717c6.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\
\deps\\libgtk_sys-7b6a2cb3d58a9155.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord
\\target\\debug\\deps\\libgdk_sys-3f75e0c9ec1fb338.rlib" "C:\\Users\\DoctorVWA\\
Desktop\\lilcord\\target\\debug\\deps\\libpango_sys-24ec8cd47f231518.rlib" "C:\\
Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libgdk_pixbuf_sys-0f254
50e1c21652e.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\
libatk_sys-42d0168c076cffbb.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\targe
t\\debug\\deps\\libgio-72895eea7e996597.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libgio_sys-55bba6f31f5b15d9.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libcairo-abb6e1489881f7d8.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libglib-6b6d3148a88811e1.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libgobject_sys-1c36f4639c197ac7.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libglib_sys-363f879bf1a50745.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\liblazy_static-4db6f52f71e2b275.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libbitflags-a0c5ccbbea449dc5.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libc_vec-66fb41a2be053426.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libcairo_sys-9c8ae188b644b7c4.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libwinapi-0aed34f6829c55ee.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\liblibc-40363f789d24d302.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\liburl-e055d48a5b753843.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libpercent_encoding-d0f5e1957f7cb514.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libidna-16faa290b01f4775.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libunicode_normalization-a2b6239c3b55ffd3.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libunicode_bidi-3dd040228b31f427.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libmatches-eba9499f8443541e.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libweb_view-40919c65876029ac.rlib" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\deps\\libfnv-362faccdd1a47124.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-a0684270ba45e4c4.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-9959500f08f0e1ba.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-15ac613a7fce0483.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-8a35d8972d0168d2.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc_system-c3eb086d76a23433.rlib"  "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-e077f5c433365928.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd_unicode-fc698978fa4eb61f.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-732d0577648c664f.rlib" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-8f1b4d5cbd48c220.rlib" "-Wl,-Bdynamic" "-l" "gtk-3" "-l" "gdk-3" "-l" "gdk-3" "-l" "pango-1.0" "-l" "gdk_pixbuf-2.0" "-l" "atk-1.0" "-l" "gio-2.0" "-l" "gobject-2.0" "-l" "glib-2.0" "-l" "gobject-2.0" "-l" "cairo" "-l" "advapi32" "-l" "ws2_32" "-l" "userenv" "-l" "shell32" "-Wl,-Bstatic" "-l" "gcc_eh" "-l" "pthread" "-Wl,-Bdynamic" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvc
rt" "-luser32" "-lkernel32" "C:\\Users\\DoctorVWA\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o): In function `EmbedBrowserObject':
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:941: undefined reference to `__imp_CoGetClassObject'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:964: undefined reference to `__imp_OleSetContainedObject
'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o): In function `DisplayHTMLPage':
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1020: undefined reference to `__imp_VariantInit'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1028: undefined reference to `__imp_SysAllocString'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1040: undefined reference to `__imp_VariantClear'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1059: undefined reference to `__imp_SafeArrayCreate'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1061: undefined reference to `__imp_SafeArrayAccessData'

          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1069: undefined reference to `__imp_SysAllocString'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1080: undefined reference to `__imp_SafeArrayDestroy'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o): In function `webview_init':
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1173: undefined reference to `__imp_OleInitialize'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1207: undefined reference to `__imp_OleUninitialize'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o): In function `webview_eval':
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1285: undefined reference to `__imp_SysAllocString'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1289: undefined reference to `__imp_SysFreeString'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1292: undefined reference to `__imp_SysFreeString'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1312: undefined reference to `__imp_SysAllocString'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1318: undefined reference to `__imp_SysFreeString'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o): In function `webview_dialog':
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1471: undefined reference to `__imp_CoCreateInstance'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1484: undefined reference to `__imp_CoCreateInstance'
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1514: undefined reference to `__imp_CoTaskMemFree'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o): In function `webview_exit':
          C:\Users\DoctorVWA\.cargo\git\checkouts\web-view-9c9481cc535a4781\310f26a/webview-c/webview.h:1547: undefined reference to `__imp_OleUninitialize'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.CLSID_FileSaveDialog[.refptr.CLSID_FileSaveDialog]+0x0): undefined reference to `CLSID_FileSaveDialog'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IFileSaveDialog[.refptr.IID_IFileSaveDialog]+0x0): undefined reference to `IID_IFileSaveDialog'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.CLSID_FileOpenDialog[.refptr.CLSID_FileOpenDialog]+0x0): undefined reference to `CLSID_FileOpenDialog'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IFileOpenDialog[.refptr.IID_IFileOpenDialog]+0x0): undefined reference to `IID_IFileOpenDialog'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.GUID_NULL[.refptr.GUID_NULL]+0x0): undefined reference to `GUID_NULL'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IOleInPlaceActiveObject[.refptr.IID_IOleInPlaceActiveObject]+0x0): undefined reference to `IID_IOleInPlaceActiveObject'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IHTMLDocument2[.refptr.IID_IHTMLDocument2]+0x0): undefined reference to `IID_IHTMLDocument2'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IWebBrowser2[.refptr.IID_IWebBrowser2]+0x0): undefined reference to `IID_IWebBrowser2'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IOleObject[.refptr.IID_IOleObject]+0x0): undefined reference to `IID_IOleObject'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.CLSID_WebBrowser[.refptr.CLSID_WebBrowser]+0x0): undefined reference to `CLSID_WebBrowser'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IClassFactory[.refptr.IID_IClassFactory]+0x0): undefined reference to `IID_IClassFactory'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IOleInPlaceObject[.refptr.IID_IOleInPlaceObject]+0x0): undefined reference to `IID_IOleInPlaceObject'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IDocHostUIHandler[.refptr.IID_IDocHostUIHandler]+0x0): undefined reference to `IID_IDocHostUIHandler'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IOleInPlaceSite[.refptr.IID_IOleInPlaceSite]+0x0): undefined reference to `IID_IOleInPlaceSite'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IOleClientSite[.refptr.IID_IOleClientSite]+0x0): undefined reference to `IID_IOleClientSite'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IUnknown[.refptr.IID_IUnknown]+0x0): undefined reference to `IID_IUnknown'
          C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libweb_view-40919c65876029ac.rlib(lib.o):lib.c:(.rdata$.refptr.IID_IDispatch[.refptr.IID_IDispatch]+0x0): undefined reference to `IID_IDispatch'

Opening a dialog fails on Windows 10

Hey great library!. I've been using it for a personal project for a few months and as i try to port my app to windows 10 i noticed this.

Offending code is called after parsing the json recieved from window.external.invoke

let file_name = view.dialog(Dialog::SaveFile, "Choose Database File", "");

And in another spot

let file_name = view.dialog(Dialog::OpenFile, "Choose Database File", "");

Both react the same way, i never see the file dialog and it immediately returns an
empty string. Any ideas what might cause this?

Segfault when run from child thread.

Hello! Thank you for building this, first of all! I've had alright success running this from the main thread, but it seems to die when run from a child. Here's the segfault:

1   0x7fdcc656c247 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18(WTFCrash+0x17) [0x7fdcc656c247]
2   0x7fdcc7ced999 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0x67d999) [0x7fdcc7ced999]
3   0x7fdcc7d31d9a /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0x6c1d9a) [0x7fdcc7d31d9a]
4   0x7fdcc7d32219 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0x6c2219) [0x7fdcc7d32219]
5   0x7fdcc7faf0d0 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0x93f0d0) [0x7fdcc7faf0d0]
6   0x7fdcc6833e72 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_object_unref+0x1a2) [0x7fdcc6833e72]
7   0x7fdcc48f0041 /lib/x86_64-linux-gnu/libc.so.6(+0x43041) [0x7fdcc48f0041]
8   0x7fdcc48f013a /lib/x86_64-linux-gnu/libc.so.6(+0x4313a) [0x7fdcc48f013a]
9   0x7fdcc48ceb9e /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xee) [0x7fdcc48ceb9e]
10  0x55777992389a target/debug/rust_ksl_uploader(+0x889a) [0x55777992389a]
Segmentation fault (core dumped)

And here's the minimal code to reproduce:

extern crate web_view;

use web_view::*;
use std::thread::spawn;

const INDEX: &str = r#"<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    This is a test.
  </body>
</html>
"#;

fn main() {
    let size = (800, 800);
    let resizable = true;
    let debug = true;
    let init_cb = |_webview| {};
    let frontend_cb = |_webview: &mut _, _arg: &_, _userdata: &mut _| {};
    let userdata = ();
    let view = spawn(move || {
        run("test thread", Content::Html(INDEX), Some(size), resizable, debug, init_cb, frontend_cb, userdata);
    });

    view.join().expect("Join Error");
}

Type Safety and More Idiomatic Rust

So I am not sure if this would be better suited as modifications to this library or something that got built on top of this library to force certain standards. Anyway, this is my idea:

One of the major advantages of Rust is its type safety over something like JavaScript. Thus, the conversion to and from JavaScript are likely to cause issues. With that in mind, the first thing that sticks out as likely to cause mistakes is this webview.eval(&format!("updateTicks({}, {})", counter, user_data)). It just looks like it is waiting for typos to happen and weird bugs. By using some sort of macro/derive, I feel like the rust function fn updateTicks(counter: u32, userdata: i32) could be generated. I get that if updateTick is called in only one place, it doesn't really matter, but as applications get bigger and you use updateTick in 5 different issues, this would defend against a lot of potential bugs, especially if updateTick is ever changed to accept another argument.

A second spot were I see major potential gains is in enforcing the use of serde for type safe commands back to rust. Basically taking what is done in todo.rs and standardizing it. This again avoids the user directly passing around strings and gives them a Rust struct instead. I feel like this would best match with typescript/purescript/elm on the frontend to standardize what JavaScript sends over, but that would likely still be up to user choice.

I know that your elm and purescript examples are self contained, but if they need access to native resources(file io for persistence, etc), then it would be import to set this up well in rust. Also, with the setup, I feel like it is easier to just let the JavaScript render/grab user input and have all the business logic in rust. I feel like this may kinda turn into building the elm architecture in rust built on top of web-view.

Any questions/thoughts/opinions? I am hoping this sounds like at least a useful idea.

Transparent frame doesn't work anymore on latest webview-sys's commit

Hey there,

The full window transparency doesn't work anymore on https://github.com/zserge/webview 's latest commit.

It used to work with an old revision:

cd webview-sys/webview
git checkout 02aa1dcf62a15f2c1e2197a07642e9c474ac32fa

Code to reproduce:

#![windows_subsystem = "windows"]

extern crate web_view;

use web_view::*;

fn main() {
    let mut web_view = WebViewBuilder::new()
        .title("Page load example")
        .content(Content::Html(HTML))
        .size(800, 600)
        .resizable(true)
        .debug(true)
        .user_data(())
        .invoke_handler(|_webview, _arg| Ok(()))
        .build()
        .unwrap();

    web_view.set_color((122, 44, 200, 0));

    let res = web_view.run().unwrap();

    println!("final state: {:?}", res);
}

const HTML: &str = r#"
<!doctype html>
<html>
    <head>
        <style>
        html, body {
            background: transparent;
            color: pink;
        }
        </style>
    </head>
	<body>
	  <h1>Hello, world</h1>
	</body>
</html>
"#;

FYI with the latest commit, only the titlebar is transparent, but the frame remains white:
screenshot 2018-11-12 14 17 10

But should be (the frame is over my terminal):
screenshot 2018-11-12 14 17 42

Which is useful to make beautiful HTML widgets.

Can't run on Ubuntu 18

Hi. Thank you for your work. I would like to try this library but it is not running in Ubuntu 18:

I just added this import to the main.rs of a running app of mine:
extern crate web_view;
use web_view::*;

And added this to the "Cargo.toml":
web-view = "0.4.1"

The rest is a running app of mine, just wanted to test webview and build from there.

But when I run "cargo build" to test it, it gives this error:

"Compiling webview-sys v0.1.2
error: failed to run custom build command for webview-sys v0.1.2
process didn't exit successfully: /home/paulo/Repos/rust/target/debug/build/webview-sys-960829160a197e3d/build-script-build (exit code: 101)
--- stderr
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at 'called Result::unwrap() on an Err value: Failure { command: ""pkg-config" "--libs" "--cflags" "webkit2gtk-4.0" "webkit2gtk-4.0 >= 2.8"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package webkit2gtk-4.0 was not found in the pkg-config search path.\nPerhaps you should add the directory containing webkit2gtk-4.0.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'webkit2gtk-4.0\' found\nPackage webkit2gtk-4.0 was not found in the pkg-config search path.\nPerhaps you should add the directory containing webkit2gtk-4.0.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'webkit2gtk-4.0' found\n" } }', src/libcore/result.rs:997:5
note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace."

Is it related to be running in Ubuntu 18? Was it tested only in windows?

example of deployment with http server/files

Hi,

great library! I am currently creating the front end in Vue JS. Now I am in development and I point the webview to localhost when the Vue JS dev server is on.

But now.. on to production. In the readme it says that local resources only work when using a http server to serve the files. However: how does one embed the files with a rust binary?

And if that is not possible, how can I use include_str! so that I don't get the "Local resource cannot be loaded" errors

Thanks

Incercept and block requests

Is it possible to intercept requests and in certain cases block them, maybe be sending a 403 Forbidden. This would be useful for running untrusted code that resides on the filesystem and preventing if from accessing external services. Or just to lock down to a certain website.

Build fails on windows.

Cargo build --verbose with rust Backtrace on: (ignore the "←[m")

←[m←[m←[32m←[1m       Fresh←[m byteorder v1.2.1
←[m←[m←[32m←[1m       Fresh←[m scoped-tls v0.1.0
←[m←[m←[32m←[1m       Fresh←[m traitobject v0.1.0
←[m←[m←[32m←[1m       Fresh←[m slab v0.4.0
←[m←[m←[32m←[1m       Fresh←[m safemem v0.2.0
←[m←[m←[32m←[1m       Fresh←[m take v0.1.0
←[m←[m←[32m←[1m       Fresh←[m siphasher v0.2.2
←[m←[m←[32m←[1m       Fresh←[m winapi-build v0.1.1
←[m←[m←[32m←[1m       Fresh←[m build_const v0.2.0
←[m←[m←[32m←[1m       Fresh←[m adler32 v1.0.2
←[m←[m←[32m←[1m       Fresh←[m percent-encoding v1.0.1
←[m←[m←[32m←[1m       Fresh←[m libc v0.2.36
←[m←[m←[32m←[1m       Fresh←[m route-recognizer v0.1.12
←[m←[m←[32m←[1m       Fresh←[m modifier v0.1.0
←[m←[m←[32m←[1m       Fresh←[m httparse v1.2.4
←[m←[m←[32m←[1m       Fresh←[m sha1 v0.2.0
←[m←[m←[32m←[1m       Fresh←[m num-traits v0.1.42
←[m←[m←[32m←[1m       Fresh←[m lazycell v0.6.0
←[m←[m←[32m←[1m       Fresh←[m dtoa v0.4.2
←[m←[m←[32m←[1m       Fresh←[m fnv v1.0.6
←[m←[m←[32m←[1m       Fresh←[m bitflags v1.0.1
←[m←[m←[32m←[1m       Fresh←[m cfg-if v0.1.2
←[m←[m←[32m←[1m       Fresh←[m slab v0.3.0
←[m←[m←[32m←[1m       Fresh←[m unicode-normalization v0.1.5
←[m←[m←[32m←[1m       Fresh←[m smallvec v0.2.1
←[m←[m←[32m←[1m       Fresh←[m c_vec v1.2.1
←[m←[m←[32m←[1m       Fresh←[m winapi v0.2.8
←[m←[m←[32m←[1m       Fresh←[m language-tags v0.2.2
←[m←[m←[32m←[1m       Fresh←[m version_check v0.1.3
←[m←[m←[32m←[1m       Fresh←[m serde v1.0.27
←[m←[m←[32m←[1m       Fresh←[m bitflags v0.9.1
←[m←[m←[32m←[1m       Fresh←[m lazy_static v1.0.0
←[m←[m←[32m←[1m       Fresh←[m typeable v0.1.2
←[m←[m←[32m←[1m       Fresh←[m lazy_static v0.2.11
←[m←[m←[32m←[1m       Fresh←[m cc v1.0.4
←[m←[m←[32m←[1m       Fresh←[m pkg-config v0.3.9
←[m←[m←[32m←[1m       Fresh←[m futures v0.1.18
←[m←[m←[32m←[1m       Fresh←[m itoa v0.3.4
←[m←[m←[32m←[1m       Fresh←[m matches v0.1.6
←[m←[m←[32m←[1m       Fresh←[m base64 v0.5.2
←[m←[m←[32m←[1m       Fresh←[m unsafe-any v0.4.2
←[m←[m←[32m←[1m       Fresh←[m base64 v0.6.0
←[m←[m←[32m←[1m       Fresh←[m base64 v0.9.0
←[m←[m←[32m←[1m       Fresh←[m num_cpus v1.8.0
←[m←[m←[32m←[1m       Fresh←[m rand v0.3.20
←[m←[m←[32m←[1m       Fresh←[m log v0.4.1
←[m←[m←[32m←[1m       Fresh←[m iovec v0.1.2
←[m←[m←[32m←[1m       Fresh←[m tokio-service v0.1.0
←[m←[m←[32m←[1m       Fresh←[m relay v0.1.1
←[m←[m←[32m←[1m       Fresh←[m serde_json v1.0.9
←[m←[m←[32m←[1m       Fresh←[m unicode-bidi v0.3.4
←[m←[m←[32m←[1m       Fresh←[m typemap v0.3.3
←[m←[m←[32m←[1m       Fresh←[m futures-cpupool v0.1.8
←[m←[m←[32m←[1m       Fresh←[m uuid v0.5.1
←[m←[m←[32m←[1m       Fresh←[m winapi-x86_64-pc-windows-gnu v0.4.0
←[m←[m←[32m←[1m       Fresh←[m log v0.3.9
←[m←[m←[32m←[1m       Fresh←[m bytes v0.4.6
←[m←[m←[32m←[1m   Compiling←[m web-view v0.1.3
←[m←[m←[32m←[1m       Fresh←[m idna v0.1.4
←[m←[m←[32m←[1m       Fresh←[m plugin v0.2.6
←[m←[m←[32m←[1m       Fresh←[m kernel32-sys v0.2.2
←[m←[m←[32m←[1m       Fresh←[m ws2_32-sys v0.2.1
←[m←[m←[32m←[1m       Fresh←[m crc v1.7.0
←[m←[m←[32m←[1m       Fresh←[m winapi v0.3.4
←[m←[m←[32m←[1m       Fresh←[m mime v0.2.6
←[m←[m←[32m←[1m       Fresh←[m tokio-io v0.1.4
←[m←[m←[32m←[1m       Fresh←[m unicase v2.1.0
←[m←[m←[32m←[1m       Fresh←[m unicase v1.4.2
←[m←[m←[32m←[1m       Fresh←[m cairo-sys-rs v0.5.0
←[m←[m←[32m←[1m       Fresh←[m glib-sys v0.5.0
←[m←[m←[32m←[1m     Running←[m `C:\Users\DoctorVWA\Desktop\lilcord\target\debug\build\web-view-46b159351e194af1\build-script-build`
←[m←[m←[32m←[1m       Fresh←[m url v1.6.0
←[m←[m←[32m←[1m   Compiling←[m net2 v0.2.31
←[m←[m←[32m←[1m     Running←[m `rustc --crate-name net2 C:\Users\DoctorVWA\.cargo\registry\src\github.com-1ecc6299db9ec823\net2-0.2.31\src\lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --c
fg "feature=\"default\"" --cfg "feature=\"duration\"" -C metadata=c1f16f978729a5eb -C extra-filename=-c1f16f978729a5eb --out-dir C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps -L dependency=C:\Use
rs\DoctorVWA\Desktop\lilcord\target\debug\deps --extern ws2_32=C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libws2_32-fe01bfb2fe96b222.rlib --extern winapi=C:\Users\DoctorVWA\Desktop\lilcord\tar
get\debug\deps\libwinapi-0aed34f6829c55ee.rlib --extern kernel32=C:\Users\DoctorVWA\Desktop\lilcord\target\debug\deps\libkernel32-0c891cf7582d023a.rlib --extern cfg_if=C:\Users\DoctorVWA\Desktop\lilcord
\target\debug\deps\libcfg_if-521ab83a67227d52.rlib --cap-lints allow`
←[m←[m←[31m←[1merror:←[m failed to run custom build command for `web-view v0.1.3`
process didn't exit successfully: `C:\Users\DoctorVWA\Desktop\lilcord\target\debug\build\web-view-46b159351e194af1\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "gcc.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-I" "webview-c" "-Wall" "-Wextra" "-DDEBUG" "-DWEBVIEW_WINAPI" "-o" "C:\\Users\\DoctorVWA\\Desktop\\lilcord\\target\\debug\\bu
ild\\web-view-f0f2775b7e0961cb\\out\\webview-c\\lib.o" "-c" "webview-c/lib.c"
cargo:warning=In file included from webview-c/lib.c:2:0:
cargo:warning=webview-c/webview.h:453:0: warning: ignoring #pragma comment  [-Wunknown-pragmas]
cargo:warning= #pragma comment(lib, "user32.lib")
cargo:warning= ^
cargo:warning=webview-c/webview.h:454:0: warning: ignoring #pragma comment  [-Wunknown-pragmas]
cargo:warning= #pragma comment(lib, "ole32.lib")
cargo:warning= ^
cargo:warning=webview-c/webview.h:455:0: warning: ignoring #pragma comment  [-Wunknown-pragmas]
cargo:warning= #pragma comment(lib, "oleaut32.lib")
cargo:warning= ^
cargo:warning=webview-c/webview.h: In function 'JS_AddRef':
cargo:warning=webview-c/webview.h:520:57: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE JS_AddRef(IDispatch FAR *This) { return 1; }
cargo:warning=                                                         ^
cargo:warning=webview-c/webview.h: In function 'JS_Release':
cargo:warning=webview-c/webview.h:521:58: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE JS_Release(IDispatch FAR *This) { return 1; }
cargo:warning=                                                          ^
cargo:warning=webview-c/webview.h: In function 'JS_GetTypeInfoCount':
cargo:warning=webview-c/webview.h:522:69: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE JS_GetTypeInfoCount(IDispatch FAR *This,
cargo:warning=                                                                     ^
cargo:warning=webview-c/webview.h:523:60: warning: unused parameter 'pctinfo' [-Wunused-parameter]
cargo:warning=                                                      UINT *pctinfo) {
cargo:warning=                                                            ^
cargo:warning=webview-c/webview.h: In function 'JS_GetTypeInfo':
cargo:warning=webview-c/webview.h:526:64: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE JS_GetTypeInfo(IDispatch FAR *This,
cargo:warning=                                                                ^
cargo:warning=webview-c/webview.h:527:54: warning: unused parameter 'iTInfo' [-Wunused-parameter]
cargo:warning=                                                 UINT iTInfo, LCID lcid,
cargo:warning=                                                      ^
cargo:warning=webview-c/webview.h:527:67: warning: unused parameter 'lcid' [-Wunused-parameter]
cargo:warning=                                                 UINT iTInfo, LCID lcid,
cargo:warning=                                                                   ^
cargo:warning=webview-c/webview.h:528:61: warning: unused parameter 'ppTInfo' [-Wunused-parameter]
cargo:warning=                                                 ITypeInfo **ppTInfo) {
cargo:warning=                                                             ^
cargo:warning=webview-c/webview.h: In function 'JS_GetIDsOfNames':
cargo:warning=webview-c/webview.h:532:66: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE JS_GetIDsOfNames(IDispatch FAR *This,
cargo:warning=                                                                  ^
cargo:warning=webview-c/webview.h:533:58: warning: unused parameter 'riid' [-Wunused-parameter]
cargo:warning=                                                   REFIID riid,
cargo:warning=                                                          ^
cargo:warning=webview-c/webview.h:535:69: warning: unused parameter 'lcid' [-Wunused-parameter]
cargo:warning=                                                   UINT cNames, LCID lcid,
cargo:warning=                                                                     ^
cargo:warning=webview-c/webview.h: In function 'JS_Invoke':
cargo:warning=webview-c/webview.h:548:60: warning: unused parameter 'riid' [-Wunused-parameter]
cargo:warning= JS_Invoke(IDispatch FAR *This, DISPID dispIdMember, REFIID riid, LCID lcid,
cargo:warning=                                                            ^
cargo:warning=webview-c/webview.h:548:71: warning: unused parameter 'lcid' [-Wunused-parameter]
cargo:warning= JS_Invoke(IDispatch FAR *This, DISPID dispIdMember, REFIID riid, LCID lcid,
cargo:warning=                                                                       ^
cargo:warning=webview-c/webview.h:549:16: warning: unused parameter 'wFlags' [-Wunused-parameter]
cargo:warning=           WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
cargo:warning=                ^
cargo:warning=webview-c/webview.h:549:58: warning: unused parameter 'pVarResult' [-Wunused-parameter]
cargo:warning=           WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
cargo:warning=                                                          ^
cargo:warning=webview-c/webview.h:550:22: warning: unused parameter 'pExcepInfo' [-Wunused-parameter]
cargo:warning=           EXCEPINFO *pExcepInfo, UINT *puArgErr) {
cargo:warning=                      ^
cargo:warning=webview-c/webview.h:550:40: warning: unused parameter 'puArgErr' [-Wunused-parameter]
cargo:warning=           EXCEPINFO *pExcepInfo, UINT *puArgErr) {
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h: In function 'Site_AddRef':
cargo:warning=webview-c/webview.h:576:64: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite FAR *This) {
cargo:warning=                                                                ^
cargo:warning=webview-c/webview.h: In function 'Site_Release':
cargo:warning=webview-c/webview.h:579:65: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite FAR *This) {
cargo:warning=                                                                 ^
cargo:warning=webview-c/webview.h: In function 'Site_SaveObject':
cargo:warning=webview-c/webview.h:582:70: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite FAR *This) {
cargo:warning=                                                                      ^
cargo:warning=webview-c/webview.h: In function 'Site_GetMoniker':
cargo:warning=webview-c/webview.h:585:70: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Site_GetMoniker(IOleClientSite FAR *This,
cargo:warning=                                                                      ^
cargo:warning=webview-c/webview.h:586:56: warning: unused parameter 'dwAssign' [-Wunused-parameter]
cargo:warning=                                                  DWORD dwAssign,
cargo:warning=                                                        ^
cargo:warning=webview-c/webview.h:587:56: warning: unused parameter 'dwWhichMoniker' [-Wunused-parameter]
cargo:warning=                                                  DWORD dwWhichMoniker,
cargo:warning=                                                        ^
cargo:warning=webview-c/webview.h:588:61: warning: unused parameter 'ppmk' [-Wunused-parameter]
cargo:warning=                                                  IMoniker **ppmk) {
cargo:warning=                                                             ^
cargo:warning=webview-c/webview.h: In function 'Site_GetContainer':
cargo:warning=webview-c/webview.h:592:39: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= Site_GetContainer(IOleClientSite FAR *This, LPOLECONTAINER FAR *ppContainer) {
cargo:warning=                                       ^
cargo:warning=webview-c/webview.h: In function 'Site_ShowObject':
cargo:warning=webview-c/webview.h:596:70: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Site_ShowObject(IOleClientSite FAR *This) {
cargo:warning=                                                                      ^
cargo:warning=webview-c/webview.h: In function 'Site_OnShowWindow':
cargo:warning=webview-c/webview.h:599:72: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Site_OnShowWindow(IOleClientSite FAR *This,
cargo:warning=                                                                        ^
cargo:warning=webview-c/webview.h:600:57: warning: unused parameter 'fShow' [-Wunused-parameter]
cargo:warning=                                                    BOOL fShow) {
cargo:warning=                                                         ^
cargo:warning=webview-c/webview.h: In function 'Site_RequestNewObjectLayout':
cargo:warning=webview-c/webview.h:604:49: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= Site_RequestNewObjectLayout(IOleClientSite FAR *This) {
cargo:warning=                                                 ^
cargo:warning=webview-c/webview.h: In function 'InPlace_AddRef':
cargo:warning=webview-c/webview.h:627:68: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite FAR *This) {
cargo:warning=                                                                    ^
cargo:warning=webview-c/webview.h: In function 'InPlace_Release':
cargo:warning=webview-c/webview.h:630:69: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite FAR *This) {
cargo:warning=                                                                     ^
cargo:warning=webview-c/webview.h: In function 'InPlace_ContextSensitiveHelp':
cargo:warning=webview-c/webview.h:639:51: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_ContextSensitiveHelp(IOleInPlaceSite FAR *This, BOOL fEnterMode) {
cargo:warning=                                                   ^
cargo:warning=webview-c/webview.h:639:62: warning: unused parameter 'fEnterMode' [-Wunused-parameter]
cargo:warning= InPlace_ContextSensitiveHelp(IOleInPlaceSite FAR *This, BOOL fEnterMode) {
cargo:warning=                                                              ^
cargo:warning=webview-c/webview.h: In function 'InPlace_CanInPlaceActivate':
cargo:warning=webview-c/webview.h:643:49: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_CanInPlaceActivate(IOleInPlaceSite FAR *This) {
cargo:warning=                                                 ^
cargo:warning=webview-c/webview.h: In function 'InPlace_OnInPlaceActivate':
cargo:warning=webview-c/webview.h:647:48: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_OnInPlaceActivate(IOleInPlaceSite FAR *This) {
cargo:warning=                                                ^
cargo:warning=webview-c/webview.h: In function 'InPlace_OnUIActivate':
cargo:warning=webview-c/webview.h:651:43: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_OnUIActivate(IOleInPlaceSite FAR *This) {
cargo:warning=                                           ^
cargo:warning=webview-c/webview.h: In function 'InPlace_GetWindowContext':
cargo:warning=webview-c/webview.h:656:47: warning: unused parameter 'lprcPosRect' [-Wunused-parameter]
cargo:warning=     LPOLEINPLACEUIWINDOW FAR *lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect,
cargo:warning=                                               ^
cargo:warning=webview-c/webview.h:656:67: warning: unused parameter 'lprcClipRect' [-Wunused-parameter]
cargo:warning=     LPOLEINPLACEUIWINDOW FAR *lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect,
cargo:warning=                                                                   ^
cargo:warning=webview-c/webview.h: In function 'InPlace_Scroll':
cargo:warning=webview-c/webview.h:666:70: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE InPlace_Scroll(IOleInPlaceSite FAR *This,
cargo:warning=                                                                      ^
cargo:warning=webview-c/webview.h:667:54: warning: unused parameter 'scrollExtent' [-Wunused-parameter]
cargo:warning=                                                 SIZE scrollExtent) {
cargo:warning=                                                      ^
cargo:warning=webview-c/webview.h: In function 'InPlace_OnUIDeactivate':
cargo:warning=webview-c/webview.h:671:45: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_OnUIDeactivate(IOleInPlaceSite FAR *This, BOOL fUndoable) {
cargo:warning=                                             ^
cargo:warning=webview-c/webview.h:671:56: warning: unused parameter 'fUndoable' [-Wunused-parameter]
cargo:warning= InPlace_OnUIDeactivate(IOleInPlaceSite FAR *This, BOOL fUndoable) {
cargo:warning=                                                        ^
cargo:warning=webview-c/webview.h: In function 'InPlace_OnInPlaceDeactivate':
cargo:warning=webview-c/webview.h:675:50: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_OnInPlaceDeactivate(IOleInPlaceSite FAR *This) {
cargo:warning=                                                  ^
cargo:warning=webview-c/webview.h: In function 'InPlace_DiscardUndoState':
cargo:warning=webview-c/webview.h:679:47: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_DiscardUndoState(IOleInPlaceSite FAR *This) {
cargo:warning=                                               ^
cargo:warning=webview-c/webview.h: In function 'InPlace_DeactivateAndUndo':
cargo:warning=webview-c/webview.h:683:48: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= InPlace_DeactivateAndUndo(IOleInPlaceSite FAR *This) {
cargo:warning=                                                ^
cargo:warning=webview-c/webview.h: In function 'Frame_QueryInterface':
cargo:warning=webview-c/webview.h:701:27: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, REFIID riid, LPVOID FAR *ppvObj) {
cargo:warning=                           ^
cargo:warning=webview-c/webview.h:701:40: warning: unused parameter 'riid' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, REFIID riid, LPVOID FAR *ppvObj) {
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h:701:58: warning: unused parameter 'ppvObj' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, REFIID riid, LPVOID FAR *ppvObj) {
cargo:warning=                                                          ^
cargo:warning=webview-c/webview.h: In function 'Frame_AddRef':
cargo:warning=webview-c/webview.h:704:67: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame FAR *This) {
cargo:warning=                                                                   ^
cargo:warning=webview-c/webview.h: In function 'Frame_Release':
cargo:warning=webview-c/webview.h:707:68: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame FAR *This) {
cargo:warning=                                                                    ^
cargo:warning=webview-c/webview.h: In function 'Frame_ContextSensitiveHelp':
cargo:warning=webview-c/webview.h:716:50: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= Frame_ContextSensitiveHelp(IOleInPlaceFrame FAR *This, BOOL fEnterMode) {
cargo:warning=                                                  ^
cargo:warning=webview-c/webview.h:716:61: warning: unused parameter 'fEnterMode' [-Wunused-parameter]
cargo:warning= Frame_ContextSensitiveHelp(IOleInPlaceFrame FAR *This, BOOL fEnterMode) {
cargo:warning=                                                             ^
cargo:warning=webview-c/webview.h: In function 'Frame_GetBorder':
cargo:warning=webview-c/webview.h:719:72: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Frame_GetBorder(IOleInPlaceFrame FAR *This,
cargo:warning=                                                                        ^
cargo:warning=webview-c/webview.h:720:57: warning: unused parameter 'lprectBorder' [-Wunused-parameter]
cargo:warning=                                                  LPRECT lprectBorder) {
cargo:warning=                                                         ^
cargo:warning=webview-c/webview.h: In function 'Frame_RequestBorderSpace':
cargo:warning=webview-c/webview.h:724:27: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, LPCBORDERWIDTHS pborderwidths) {
cargo:warning=                           ^
cargo:warning=webview-c/webview.h:724:49: warning: unused parameter 'pborderwidths' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, LPCBORDERWIDTHS pborderwidths) {
cargo:warning=                                                 ^
cargo:warning=webview-c/webview.h: In function 'Frame_SetBorderSpace':
cargo:warning=webview-c/webview.h:728:27: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, LPCBORDERWIDTHS pborderwidths) {
cargo:warning=                           ^
cargo:warning=webview-c/webview.h:728:49: warning: unused parameter 'pborderwidths' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, LPCBORDERWIDTHS pborderwidths) {
cargo:warning=                                                 ^
cargo:warning=webview-c/webview.h: In function 'Frame_SetActiveObject':
cargo:warning=webview-c/webview.h:732:27: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, IOleInPlaceActiveObject *pActiveObject,
cargo:warning=                           ^
cargo:warning=webview-c/webview.h:732:58: warning: unused parameter 'pActiveObject' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame FAR *This, IOleInPlaceActiveObject *pActiveObject,
cargo:warning=                                                          ^
cargo:warning=webview-c/webview.h:733:15: warning: unused parameter 'pszObjName' [-Wunused-parameter]
cargo:warning=     LPCOLESTR pszObjName) {
cargo:warning=               ^
cargo:warning=webview-c/webview.h: In function 'Frame_InsertMenus':
cargo:warning=webview-c/webview.h:737:41: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= Frame_InsertMenus(IOleInPlaceFrame FAR *This, HMENU hmenuShared,
cargo:warning=                                         ^
cargo:warning=webview-c/webview.h:737:53: warning: unused parameter 'hmenuShared' [-Wunused-parameter]
cargo:warning= Frame_InsertMenus(IOleInPlaceFrame FAR *This, HMENU hmenuShared,
cargo:warning=                                                     ^
cargo:warning=webview-c/webview.h:738:40: warning: unused parameter 'lpMenuWidths' [-Wunused-parameter]
cargo:warning=                   LPOLEMENUGROUPWIDTHS lpMenuWidths) {
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h: In function 'Frame_SetMenu':
cargo:warning=webview-c/webview.h:741:70: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Frame_SetMenu(IOleInPlaceFrame FAR *This,
cargo:warning=                                                                      ^
cargo:warning=webview-c/webview.h:742:54: warning: unused parameter 'hmenuShared' [-Wunused-parameter]
cargo:warning=                                                HMENU hmenuShared,
cargo:warning=                                                      ^
cargo:warning=webview-c/webview.h:743:57: warning: unused parameter 'holemenu' [-Wunused-parameter]
cargo:warning=                                                HOLEMENU holemenu,
cargo:warning=                                                         ^
cargo:warning=webview-c/webview.h:744:53: warning: unused parameter 'hwndActiveObject' [-Wunused-parameter]
cargo:warning=                                                HWND hwndActiveObject) {
cargo:warning=                                                     ^
cargo:warning=webview-c/webview.h: In function 'Frame_RemoveMenus':
cargo:warning=webview-c/webview.h:747:74: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Frame_RemoveMenus(IOleInPlaceFrame FAR *This,
cargo:warning=                                                                          ^
cargo:warning=webview-c/webview.h:748:58: warning: unused parameter 'hmenuShared' [-Wunused-parameter]
cargo:warning=                                                    HMENU hmenuShared) {
cargo:warning=                                                          ^
cargo:warning=webview-c/webview.h: In function 'Frame_SetStatusText':
cargo:warning=webview-c/webview.h:751:76: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE Frame_SetStatusText(IOleInPlaceFrame FAR *This,
cargo:warning=                                                                            ^
cargo:warning=webview-c/webview.h:752:64: warning: unused parameter 'pszStatusText' [-Wunused-parameter]
cargo:warning=                                                      LPCOLESTR pszStatusText) {
cargo:warning=                                                                ^
cargo:warning=webview-c/webview.h: In function 'Frame_EnableModeless':
cargo:warning=webview-c/webview.h:756:44: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= Frame_EnableModeless(IOleInPlaceFrame FAR *This, BOOL fEnable) {
cargo:warning=                                            ^
cargo:warning=webview-c/webview.h:756:55: warning: unused parameter 'fEnable' [-Wunused-parameter]
cargo:warning= Frame_EnableModeless(IOleInPlaceFrame FAR *This, BOOL fEnable) {
cargo:warning=                                                       ^
cargo:warning=webview-c/webview.h: In function 'Frame_TranslateAccelerator':
cargo:warning=webview-c/webview.h:760:50: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= Frame_TranslateAccelerator(IOleInPlaceFrame FAR *This, LPMSG lpmsg, WORD wID) {
cargo:warning=                                                  ^
cargo:warning=webview-c/webview.h:760:62: warning: unused parameter 'lpmsg' [-Wunused-parameter]
cargo:warning= Frame_TranslateAccelerator(IOleInPlaceFrame FAR *This, LPMSG lpmsg, WORD wID) {
cargo:warning=                                                              ^
cargo:warning=webview-c/webview.h:760:74: warning: unused parameter 'wID' [-Wunused-parameter]
cargo:warning= Frame_TranslateAccelerator(IOleInPlaceFrame FAR *This, LPMSG lpmsg, WORD wID) {
cargo:warning=                                                                          ^
cargo:warning=webview-c/webview.h: In function 'UI_AddRef':
cargo:warning=webview-c/webview.h:771:65: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler FAR *This) {
cargo:warning=                                                                 ^
cargo:warning=webview-c/webview.h: In function 'UI_Release':
cargo:warning=webview-c/webview.h:774:66: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static ULONG STDMETHODCALLTYPE UI_Release(IDocHostUIHandler FAR *This) {
cargo:warning=                                                                  ^
cargo:warning=webview-c/webview.h: In function 'UI_ShowContextMenu':
cargo:warning=webview-c/webview.h:778:28: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwID, POINT __RPC_FAR *ppt,
cargo:warning=                            ^
cargo:warning=webview-c/webview.h:778:40: warning: unused parameter 'dwID' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwID, POINT __RPC_FAR *ppt,
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h:778:63: warning: unused parameter 'ppt' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwID, POINT __RPC_FAR *ppt,
cargo:warning=                                                               ^
cargo:warning=webview-c/webview.h:779:25: warning: unused parameter 'pcmdtReserved' [-Wunused-parameter]
cargo:warning=     IUnknown __RPC_FAR *pcmdtReserved, IDispatch __RPC_FAR *pdispReserved) {
cargo:warning=                         ^
cargo:warning=webview-c/webview.h:779:61: warning: unused parameter 'pdispReserved' [-Wunused-parameter]
cargo:warning=     IUnknown __RPC_FAR *pcmdtReserved, IDispatch __RPC_FAR *pdispReserved) {
cargo:warning=                                                             ^
cargo:warning=webview-c/webview.h: In function 'UI_GetHostInfo':
cargo:warning=webview-c/webview.h:783:39: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= UI_GetHostInfo(IDocHostUIHandler FAR *This, DOCHOSTUIINFO __RPC_FAR *pInfo) {
cargo:warning=                                       ^
cargo:warning=webview-c/webview.h: In function 'UI_ShowUI':
cargo:warning=webview-c/webview.h:790:28: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwID,
cargo:warning=                            ^
cargo:warning=webview-c/webview.h:790:40: warning: unused parameter 'dwID' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwID,
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h:791:40: warning: unused parameter 'pActiveObject' [-Wunused-parameter]
cargo:warning=     IOleInPlaceActiveObject __RPC_FAR *pActiveObject,
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h:792:34: warning: unused parameter 'pCommandTarget' [-Wunused-parameter]
cargo:warning=     IOleCommandTarget __RPC_FAR *pCommandTarget,
cargo:warning=                                  ^
cargo:warning=webview-c/webview.h:793:33: warning: unused parameter 'pFrame' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame __RPC_FAR *pFrame, IOleInPlaceUIWindow __RPC_FAR *pDoc) {
cargo:warning=                                 ^
cargo:warning=webview-c/webview.h:793:72: warning: unused parameter 'pDoc' [-Wunused-parameter]
cargo:warning=     IOleInPlaceFrame __RPC_FAR *pFrame, IOleInPlaceUIWindow __RPC_FAR *pDoc) {
cargo:warning=                                                                        ^
cargo:warning=webview-c/webview.h: In function 'UI_HideUI':
cargo:warning=webview-c/webview.h:796:67: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE UI_HideUI(IDocHostUIHandler FAR *This) {
cargo:warning=                                                                   ^
cargo:warning=webview-c/webview.h: In function 'UI_UpdateUI':
cargo:warning=webview-c/webview.h:799:69: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE UI_UpdateUI(IDocHostUIHandler FAR *This) {
cargo:warning=                                                                     ^
cargo:warning=webview-c/webview.h: In function 'UI_EnableModeless':
cargo:warning=webview-c/webview.h:802:75: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= static HRESULT STDMETHODCALLTYPE UI_EnableModeless(IDocHostUIHandler FAR *This,
cargo:warning=                                                                           ^
cargo:warning=webview-c/webview.h:803:57: warning: unused parameter 'fEnable' [-Wunused-parameter]
cargo:warning=                                                    BOOL fEnable) {
cargo:warning=                                                         ^
cargo:warning=webview-c/webview.h: In function 'UI_OnDocWindowActivate':
cargo:warning=webview-c/webview.h:807:47: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= UI_OnDocWindowActivate(IDocHostUIHandler FAR *This, BOOL fActivate) {
cargo:warning=                                               ^
cargo:warning=webview-c/webview.h:807:58: warning: unused parameter 'fActivate' [-Wunused-parameter]
cargo:warning= UI_OnDocWindowActivate(IDocHostUIHandler FAR *This, BOOL fActivate) {
cargo:warning=                                                          ^
cargo:warning=webview-c/webview.h: In function 'UI_OnFrameWindowActivate':
cargo:warning=webview-c/webview.h:811:49: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= UI_OnFrameWindowActivate(IDocHostUIHandler FAR *This, BOOL fActivate) {
cargo:warning=                                                 ^
cargo:warning=webview-c/webview.h:811:60: warning: unused parameter 'fActivate' [-Wunused-parameter]
cargo:warning= UI_OnFrameWindowActivate(IDocHostUIHandler FAR *This, BOOL fActivate) {
cargo:warning=                                                            ^
cargo:warning=webview-c/webview.h: In function 'UI_ResizeBorder':
cargo:warning=webview-c/webview.h:815:40: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= UI_ResizeBorder(IDocHostUIHandler FAR *This, LPCRECT prcBorder,
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h:815:54: warning: unused parameter 'prcBorder' [-Wunused-parameter]
cargo:warning= UI_ResizeBorder(IDocHostUIHandler FAR *This, LPCRECT prcBorder,
cargo:warning=                                                      ^
cargo:warning=webview-c/webview.h:816:48: warning: unused parameter 'pUIWindow' [-Wunused-parameter]
cargo:warning=                 IOleInPlaceUIWindow __RPC_FAR *pUIWindow, BOOL fRameWindow) {
cargo:warning=                                                ^
cargo:warning=webview-c/webview.h:816:64: warning: unused parameter 'fRameWindow' [-Wunused-parameter]
cargo:warning=                 IOleInPlaceUIWindow __RPC_FAR *pUIWindow, BOOL fRameWindow) {
cargo:warning=                                                                ^
cargo:warning=webview-c/webview.h: In function 'UI_TranslateAccelerator':
cargo:warning=webview-c/webview.h:820:48: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= UI_TranslateAccelerator(IDocHostUIHandler FAR *This, LPMSG lpMsg,
cargo:warning=                                                ^
cargo:warning=webview-c/webview.h:820:60: warning: unused parameter 'lpMsg' [-Wunused-parameter]
cargo:warning= UI_TranslateAccelerator(IDocHostUIHandler FAR *This, LPMSG lpMsg,
cargo:warning=                                                            ^
cargo:warning=webview-c/webview.h:821:47: warning: unused parameter 'pguidCmdGroup' [-Wunused-parameter]
cargo:warning=                         const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID) {
cargo:warning=                                               ^
cargo:warning=webview-c/webview.h:821:68: warning: unused parameter 'nCmdID' [-Wunused-parameter]
cargo:warning=                         const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID) {
cargo:warning=                                                                    ^
cargo:warning=webview-c/webview.h: In function 'UI_GetOptionKeyPath':
cargo:warning=webview-c/webview.h:825:28: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, LPOLESTR __RPC_FAR *pchKey, DWORD dw) {
cargo:warning=                            ^
cargo:warning=webview-c/webview.h:825:54: warning: unused parameter 'pchKey' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, LPOLESTR __RPC_FAR *pchKey, DWORD dw) {
cargo:warning=                                                      ^
cargo:warning=webview-c/webview.h:825:68: warning: unused parameter 'dw' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, LPOLESTR __RPC_FAR *pchKey, DWORD dw) {
cargo:warning=                                                                    ^
cargo:warning=webview-c/webview.h: In function 'UI_GetDropTarget':
cargo:warning=webview-c/webview.h:829:28: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, IDropTarget __RPC_FAR *pDropTarget,
cargo:warning=                            ^
cargo:warning=webview-c/webview.h:829:57: warning: unused parameter 'pDropTarget' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, IDropTarget __RPC_FAR *pDropTarget,
cargo:warning=                                                         ^
cargo:warning=webview-c/webview.h:830:39: warning: unused parameter 'ppDropTarget' [-Wunused-parameter]
cargo:warning=     IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget) {
cargo:warning=                                       ^
cargo:warning=webview-c/webview.h: In function 'UI_TranslateUrl':
cargo:warning=webview-c/webview.h:839:28: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwTranslate, OLECHAR __RPC_FAR *pchURLIn,
cargo:warning=                            ^
cargo:warning=webview-c/webview.h:839:40: warning: unused parameter 'dwTranslate' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwTranslate, OLECHAR __RPC_FAR *pchURLIn,
cargo:warning=                                        ^
cargo:warning=webview-c/webview.h:839:72: warning: unused parameter 'pchURLIn' [-Wunused-parameter]
cargo:warning=     IDocHostUIHandler FAR *This, DWORD dwTranslate, OLECHAR __RPC_FAR *pchURLIn,
cargo:warning=                                                                        ^
cargo:warning=webview-c/webview.h: In function 'UI_FilterDataObject':
cargo:warning=webview-c/webview.h:845:44: warning: unused parameter 'This' [-Wunused-parameter]
cargo:warning= UI_FilterDataObject(IDocHostUIHandler FAR *This, IDataObject __RPC_FAR *pDO,
cargo:warning=                                            ^
cargo:warning=webview-c/webview.h:845:73: warning: unused parameter 'pDO' [-Wunused-parameter]
cargo:warning= UI_FilterDataObject(IDocHostUIHandler FAR *This, IDataObject __RPC_FAR *pDO,
cargo:warning=                                                                         ^
cargo:warning=webview-c/webview.h: In function 'DisplayHTMLPage':
cargo:warning=webview-c/webview.h:1047:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
cargo:warning=     for (const char *p = webview_url + strlen(WEBVIEW_DATA_URL_PREFIX); *q = *p;
cargo:warning=     ^
cargo:warning=webview-c/webview.h:1047:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
cargo:warning=webview-c/webview.h:1047:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
cargo:warning=webview-c/webview.h:1050:9: warning: format '%x' expects argument of type 'unsigned int *', but argument 3 has type 'char *' [-Wformat=]
cargo:warning=         sscanf(p + 1, "%02x", q);
cargo:warning=         ^
cargo:warning=webview-c/webview.h: In function 'webview_terminate':
cargo:warning=webview-c/webview.h:1546:52: warning: unused parameter 'w' [-Wunused-parameter]
cargo:warning= WEBVIEW_API void webview_terminate(struct webview *w) { PostQuitMessage(0); }
cargo:warning=                                                    ^
cargo:warning=webview-c/webview.h: In function 'webview_exit':
cargo:warning=webview-c/webview.h:1547:47: warning: unused parameter 'w' [-Wunused-parameter]
cargo:warning= WEBVIEW_API void webview_exit(struct webview *w) { OleUninitialize(); }
cargo:warning=                                               ^
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "gcc.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-I" "webview-c" "-Wall" "-Wextra" "-DDEBUG" "-DWEBVIEW_WINAPI" "-o" "C:\\Users\\DoctorVWA\\Desktop\\li
lcord\\target\\debug\\build\\web-view-f0f2775b7e0961cb\\out\\webview-c\\lib.o" "-c" "webview-c/lib.c" with args "gcc.exe" did not execute successfully (status code exit code: 1).

', C:\Users\DoctorVWA\.cargo\registry\src\github.com-1ecc6299db9ec823\cc-1.0.4\src\lib.rs:1984:4
stack backtrace:
   0: std::sys_common::backtrace::_print
             at src\libstd\sys\windows\backtrace/mod.rs:65
             at src\libstd\sys_common/backtrace.rs:68
   1: std::panicking::default_hook::{{closure}}
             at src\libstd\sys_common/backtrace.rs:57
             at src\libstd/panicking.rs:381
   2: std::panicking::default_hook
             at src\libstd/panicking.rs:397
   3: std::panicking::rust_panic_with_hook
             at src\libstd/panicking.rs:577
   4: std::panicking::begin_panic
             at src\libstd/panicking.rs:538
   5: std::panicking::begin_panic_fmt
             at src\libstd/panicking.rs:522
   6: cc::fail
             at C:\Users\DoctorVWA\.cargo\registry\src\github.com-1ecc6299db9ec823\cc-1.0.4\src/lib.rs:1984
   7: cc::Build::compile
             at C:\Users\DoctorVWA\.cargo\registry\src\github.com-1ecc6299db9ec823\cc-1.0.4\src/lib.rs:875
   8: build_script_build::main
             at .\build.rs:33
   9: _rust_maybe_catch_panic
             at src\libpanic_unwind/lib.rs:101
  10: std::rt::lang_start
             at src\libstd/panicking.rs:459
             at src\libstd/panic.rs:365
             at src\libstd/rt.rs:58
  11: main
  12: _tmainCRTStartup
  13: mainCRTStartup
  14: unit_addrs_search

←[m←[m←[33m←[1mwarning:←[m build failed, waiting for other jobs to finish...
←[m←[m←[31m←[1merror:←[m build failed

Versions:

cargo 0.24.0 (45043115c 2017-12-05)
rustc 1.23.0 (766bd11c8 2018-01-01)
rustup 1.7.0 (813f7b7a8 2017-10-30)

gcc (x86_64-posix-sjlj-rev3, Built by MinGW-W64 project) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Toolchain/target:
x86_64-pc-windows-gnu

OS:

Windows 7 Ultimate 64 bits SP 1

My Cargo.toml:

[package]

name = "lilcord"
version = "0.0.1"
authors = [ "DoctorVWA "]

[dependencies]

cairo-rs   = "0.3.0"
gdk        = "0.7.0"
gdk-pixbuf = "0.3.0"
gio        = "0.3.0"
glib       = "0.4.0"
gtk        = "0.3.0"
iron       = "0.6.0"
pango      = "0.3.0"
reqwest    = "0.8.1"
router     = "0.6.0"
sourceview = "0.3.0"
url        = "1.6.0"
websocket  = "0.20.2"
web-view   = "0.1.3"

[features]

default  = ["gtk/v3_16"]
gtk_3_10 = ["gtk/v3_10"]

Allow not terminating the app on WebView drop

Currently dropping the instance of WebView causes app termination (at least, on macOS).

Though convenient for simple cases, this isn't flexible enough for applications where the main window is not expected to be present at all time (such as menubar applications on macOS or tray apps on Windows).

Proposed solution: add a property that would allow to skip the termination when the window is dropped.

I can introduce the necessary changes and publish a PR, if the proposal is accepted.

Dual web views within 1 window?

I would like to build a GUI that has a web view containing links that open web apps / sites within an adjacent web view, all within the same Window.

Is it possible to render multiple web-views within the same window?

Building a snapcraft package with web-view as dependencies

Full detail

TL;DR:

I had no problem and building and running the rust app in my workstation.
Publishing and installing the snap package and running it however, will have this error.

Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"

** (svgbob-desktop:20418): ERROR **: Unable to fork a new child process: Failed to execute child process "/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitWebProcess" (No such file or directory)
Trace/breakpoint trap

However, trying to launch the binary snap package created in the $SNAP directory

/snap/svgbob-editor2/current/bin/svgbob-desktop

would launch the app with no problem, since I have the webkit gtk installed in my workstation anyway.
It wouldn't be the same thing when other users want to use my snap package.

I think this has to do with how rust links the dependencies and is not the same way as snacraft expected it to be.

web-view 0.1.2 dependency fails Travis builds

Thanks for this library, it's proving very useful to me. Unfortunately, the latest release fails to build on Travis. Looking through your commit history, it looks like you fixed this after you published the latest release?

I could just depend on an unpublished commit, but I've got three requests that would generally make usage of your library much easier, please could you:

  1. Release a new version that builds on Travis.

  2. Tag your release commits (and push the tags to GitHub) so it's easy to see what got released when. AFAIK there's no way to map between commits and versions published on crates.io, which makes it difficult to tell what changes are included in what release.

  3. Indicate what version of zserge/webview you're using? It looks like you've included the C header from zserge/webview in this repo, but I can't find anything that says what revision you got that header from. Again, it makes keeping track of changes pretty difficult, and it looks like the upstream repo is pretty active.

    When I pull external code into my repos, one of the things I do is include the hash of the commit in the upstream repo I got the code from in my commit message, something like that would be great.

Thanks!

Error compiling webview-sys (cc exit code: 1)

There already was a similar issue: #24.
It is not related as the error message is different. Library libwebkit2gtk-4.0-dev is installed.

=====================
error: failed to run custom build command for webview-sys v0.1.1
process didn't exit successfully: /home/max/Projects/Idea Projects/uitaco/target/debug/build/webview-sys-d408c386a20b93e9/build-script-build (exit code: 101)
--- stderr
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
thread 'main' panicked at '

Internal error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "webview" "-I" "/usr/include/webkitgtk-4.0" "-I" "/usr/include/gtk-3.0" "-I" "/usr/include/at-spi2-atk/2.0" "-I" "/usr/include/at-spi-2.0" "-I" "/usr/include/dbus-1.0" "-I" "/usr/lib/x86_64-linux-gnu/dbus-1.0/include" "-I" "/usr/include/gtk-3.0" "-I" "/usr/include/gio-unix-2.0/" "-I" "/usr/include/cairo" "-I" "/usr/include/pango-1.0" "-I" "/usr/include/harfbuzz" "-I" "/usr/include/pango-1.0" "-I" "/usr/include/atk-1.0" "-I" "/usr/include/cairo" "-I" "/usr/include/pixman-1" "-I" "/usr/include/freetype2" "-I" "/usr/include/libpng16" "-I" "/usr/include/freetype2" "-I" "/usr/include/libpng16" "-I" "/usr/include/gdk-pixbuf-2.0" "-I" "/usr/include/libpng16" "-I" "/usr/include/libsoup-2.4" "-I" "/usr/include/libxml2" "-I" "/usr/include/webkitgtk-4.0" "-I" "/usr/include/glib-2.0" "-I" "/usr/lib/x86_64-linux-gnu/glib-2.0/include" "-Wall" "-Wextra" "-std=c11" "-w" "-DDEBUG" "-DWEBVIEW_GTK" "-o" "/home/max/Projects/Idea Projects/uitaco/target/debug/build/webview-sys-26f3fd6b66fc836b/out/webview.o" "-c" "webview.c" with args "cc" did not execute successfully (status code exit code: 1).

', /home/max/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.32/src/lib.rs:2367:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:70
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:58
at src/libstd/panicking.rs:200
3: std::panicking::default_hook
at src/libstd/panicking.rs:215
4: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:478
5: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:385
6: std::panicking::begin_panic_fmt
at src/libstd/panicking.rs:340
7: cc::fail
at /home/max/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.32/src/lib.rs:2367
8: cc::Build::compile
at /home/max/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.32/src/lib.rs:951
9: build_script_build::main
at ./build.rs:66
10: std::rt::lang_start::{{closure}}
at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/rt.rs:64
11: std::panicking::try::do_call
at src/libstd/rt.rs:49
at src/libstd/panicking.rs:297
12: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:92
13: std::rt::lang_start_internal
at src/libstd/panicking.rs:276
at src/libstd/panic.rs:388
at src/libstd/rt.rs:48
14: std::rt::lang_start
at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/rt.rs:64
15: main
16: __libc_start_main
17: _start

web-view sample using Yew

Hello..trying to find sample on using yew framework and wrap it with web-view. Any sample please.

Thanks in advance.

VIRT memory on Linux at >80GB+.

Testcase, using web-view v0.4.0.

extern crate web_view;

fn main() {
    web_view::builder()
        .content(web_view::Content::Html(":("))
        .user_data(())
        .invoke_handler(|_w, _a| Ok(()))
        .run()
        .unwrap();
}

Screenshot of htop output while running cargo run with the above code:

screenshot_20190116_233126

Apply clippy suggestions

cargo clippy results in several improvements to this lib. We can categorise them in 3 categories:

  • unnecessary code (f.e. explicit lifetimes) - easy to fix, just follow the suggestions
  • #[inline(always)] - it shouldn't be used for performance tuning (lto in Cargo.toml does better job), but sometimes it is required for other reasons
  • run() taking too many arguments - I agree that a struct may be a better choice (as parameters are named and Rust compiler enforces using all fields, but whether to change API or not is a package dev's choice

Suggestion: Ability to add a top left/tab icon

Following your suggestion I've added an icon to my exe file. It would be nice to also be able to add a top left/tab icon, but at least the naive approach of adding <link rel="icon" src="app-icon.png"> doesn't work. (In fact I can't seem to use local/folder paths at all).

SIGSEGV when a sleep isn't done after a dispatch

The following code crashes:

#![allow(unused_imports)]

use std::thread::{spawn, sleep};
use std::time::Duration;
use urlencoding;
use web_view as webview;

pub fn main() {
	let size      = (800, 600);
	let resizable = true;
	let debug     = true;
	let url       = "data:text/html,".to_string() + &urlencoding::encode(HTML);
	webview::run("timer example", &url, Some(size), resizable, debug, move |webview| {
		spawn(move || {
			webview.dispatch(|_webview, _userdata| {});
			//sleep(Duration::from_millis(100));
		});
	}, move |_webview, _arg, _userdata| {
	}, ());
}

const HTML: &'static str = r#"
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>laspad</title>
	</head>
	<body>
	</body>
</html>
"#;

If you uncomment the sleep, it runs successfully.

Context menu / app menu?

Just a question, but is there any way to create an application menu or a right-click context menu using webview? Thanks.

Forking webview

Given the upstream library is currently unmaintained, I think we should be looking at maintaining our own fork, so the crate is actually usable.

Most obviously for me, file dialogs don't work properly on Windows because of two uninitialized variables - a fix that could scarcely be more trivial.

I currently maintain my own fork for Compactor that fixes this and various other things - memory leaks, missed allocation checks, lack of error checking in the message loop, and trims some unnecessary allocations.

Checking this out manually and setting an env var to override is fragile and annoying, so I also have a fork of this create that exists entirely to point to my webview fork. This is also less than ideal, and it's already spread to at least one other project.

Shall we nip this in the bud?

Blank page with vue

Hi! I've been trying to use webview to display my vue app with no success.

steps

  1. Build dist bundle with parcel (along with babel-polyfill).
  2. Create a webview app with the following snippet:
use web_view::*;

fn main() {
    let content = include_str!("frontend/dist/index.html");

    WebViewBuilder::new()
        .title("Minimal webview example")
        .content(Content::Html(content))
        .size(800, 600)
        .resizable(true)
        .debug(true)
        .user_data(())
        .invoke_handler(|_webview, _arg| Ok(()))
        .run()
        .unwrap();
}
  1. It will open a window, with the the correct structure arched by vue.
  2. However it just show nothing there. I try to add a console.log message in the javascript file, but nothing happens.

2019-06-20 01-06-45 的螢幕擷圖

Would be glad if someone can help me out.

Cross-Compiling for ARMv7

If I try cross-compiling a test-application I get following error (cross compiling a simple println!("Hello World") works, saying the error comes by trying to compile a webview example):

error: failed to run custom build command for `webview-sys v0.1.0`
process didn't exit successfully: `/home/user/TestApp/target/debug/build/webview-sys-08b7b43d331ebca0/build-script-build` (exit code: 101)
--- stderr
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: CrossCompilation', libcore/result.rs:945:5

EdgeHTML

You shouldn't have to target IE11 unless you want to support Windows 8 or earlier.

Unicode support for windows.

On windows platform, the title with noascii chars can not be shown correctly.
The string should be OsStr not Cstr.

is there a way to supress the console.log output?

Whenever console.log is called in my javascript, the whole html document is printed before the console.log output.
Maybe the intention was to log the url of where the debugging info comes from, but using a data/html url with the inlined html would take up all the screen.

Segfault when running any example with Edge

When running any of the examples with the edge feature enabled I'm getting an access violation (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN).

ucrtbase.dll!abort()
ucrtbase.dll!terminate()
dialog.exe!`winrt::to_hresult'::`1'::catch$5() Line 4599
	at C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt\winrt\base.h(4599)
vcruntime140_1.dll!_CallSettingFrame_LookupContinuationIndex()
vcruntime140_1.dll!__FrameHandler4::CxxCallCatchBlock(struct _EXCEPTION_RECORD *)
ntdll.dll!RcConsolidateFrames()
dialog.exe!winrt::to_hresult() Line 4574
	at C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt\winrt\base.h(4574)
dialog.exe!`winrt::impl::delegate<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl,winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs>>::type<<lambda_04b02dc4d8258bdef020ee9648caadb1>>::Invoke'::`1'::catch$0() Line 9017
	at C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt\winrt\base.h(9017)
vcruntime140_1.dll!_CallSettingFrame_LookupContinuationIndex()
vcruntime140_1.dll!__FrameHandler4::CxxCallCatchBlock(struct _EXCEPTION_RECORD *)
ntdll.dll!RcConsolidateFrames()
dialog.exe!winrt::impl::delegate<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl,winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs>>::type<<lambda_04b02dc4d8258bdef020ee9648caadb1>>::Invoke(void * sender=0x0000021e6c392c80, void * args=0x0000021e6c392a00) Line 9015
	at C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt\winrt\base.h(9015)
EdgeManager.dll!Microsoft::WRL::InvokeTraits<-2>::InvokeDelegates<<lambda_6c3a5ff7cf338864a8a9147abc6a0185>,Windows::Foundation::ITypedEventHandler<WebRuntime::Diagnostics::DiagnosticsTarget * __ptr64,WebRuntime::Diagnostics::IDiagnosticsMessageReceivedEventArgs * __ptr64>>()
EdgeManager.dll!Microsoft::WRL::EventSource<struct Windows::Foundation::ITypedEventHandler<class Windows::UI::Core::CoreWindowSite *,class Windows::UI::Core::NavigationFocusEventArgs *>,struct Microsoft::WRL::InvokeModeOptions<-2> >::InvokeAll<struct Windows::UI::Core::ICoreWindowSite *,struct Windows::UI::Core::INavigationFocusEventArgs *>(struct Windows::UI::Core::ICoreWindowSite *,struct Windows::UI::Core::INavigationFocusEventArgs *)
EdgeManager.dll!Windows::Web::UI::WebViewControlBase::OnCoreWebViewNavigationStarting(struct ICoreWebViewPrivate *,struct CoreWebViewNavigationStartingEventDetails *,int *)
EdgeManager.dll!CCoreWebViewControl::CanNavigate(unsigned short *,long &)
EdgeManager.dll!CCoreWebViewControl::NavigateToStringInternal(unsigned short *)
EdgeManager.dll!CCoreWebViewControl::NavigateToString(unsigned short *)
EdgeManager.dll!Windows::Web::UI::WebViewControlBase::NavigateToString(struct HSTRING__ *)
dialog.exe!winrt::impl::consume_Windows_Web_UI_IWebViewControl<winrt::Windows::Web::UI::IWebViewControl>::NavigateToString(const winrt::param::hstring & text={...}) Line 116
	at C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt\winrt\Windows.Web.UI.h(116)
dialog.exe!webview::webview::navigate(const char * url=0x0000021e69c1eb90) Line 628
	at C:\Users\samgr\src\web-view-rs\webview-sys\webview_edge.h(628)
dialog.exe!webview_navigate(void * w=0x0000021e69c1ce50, const char * url=0x0000021e69c1eb90) Line 714
	at C:\Users\samgr\src\web-view-rs\webview-sys\webview_edge.h(714)
dialog.exe!wrapper_webview_new(const char * title=0x0000021e69c27f50, const char * url=0x0000021e69c1eb90, int width=800, int height=600, int resizable=1, int debug=1, void(*)(void *, const char *) external_invoke_cb=0x00007ff6e7d03ba0, void * userdata=0x0000021e69c29bf0) Line 15
	at C:\Users\samgr\src\web-view-rs\webview-sys\webview_edge.cc(15)
dialog.exe!web_view::WebView<()>::new<(),closure-0>(std::ffi::c_str::CStr * title=0x0000021e69c27f50, int url, int width, bool height=600, bool resizable=true, ..., dialog::main::closure-0 debug=true) Line 290
	at C:\Users\samgr\src\web-view-rs\src\lib.rs(290)
dialog.exe!web_view::WebViewBuilder<(), closure-0, str*>::build<(),closure-0,str*>(web_view::WebViewBuilder<(), closure-0, str*> self) Line 214
	at C:\Users\samgr\src\web-view-rs\src\lib.rs(214)
dialog.exe!dialog::main() Line 8
	at C:\Users\samgr\src\web-view-rs\examples\dialog.rs(8)

Minidump

Chromep. Use an embedded chrome on all desktops

This is just an idea but it seems to solve a ton of issues.

Basically there is a new golang project that allows you to embed chrome into your app for every desktop. So you get the same browser and you control it's update.
Zserge/Lorca is its name.

Now rust has compelling wasm story. So why not try to use the Lorca approach. It's really just using the chrome tooling API to do its magic and when you look at the Lorca code you can see how simple it would be to support rust.

You can do almost everything you can do with fat electron.
The one thing I have not worked out is how to have an app icon when it opens. It shows the Google Chrome icon.

This would be an awesome setup to use with yew. I have been playing with yew and am amazed how easy and well done it is.

Btw if anyone knows a yew project using the material design components please holler :)

Data in dispatch closure does not live long enough

Might be related to #15 I built an app with web-view and was experiencing problems with corrupted data and crashes. Using jemalloc diagnostics I was able to determine that a String that was created outside the closure was being dropped, then the closure was using it. Here's how I ran it:

MALLOC_CONF="junk:true" cargo run

Looking at the code I can see some lifetime annotations that have been commented out. Uncommenting these immediately gave an error that the value did not live long enough and that I needed to use move.

update crates.io version?

having the examples on this repository not work with the latest version from crates.io is confusing

Add a string escaping function.

#6 shows that there's a very obvious need to escape strings before passing them to Javascript, that's not fulfilled by a library like serde_json. So I think it'd be useful to add one to this library, so that users are less likely to accidentally introduce edge cases like that into their own apps.

You could include the one from my ripoff of this library. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.