Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Dec 31, 2022
1 parent c9e1a61 commit de22b48
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() -> wry::Result<()> {
.with_title("Hello World")
.build(&event_loop)?;
let _webview = WebViewBuilder::new(window)?
.with_url("https://tauri.studio")?
.with_url("https://tauri.studio", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion bench/tests/src/cpu_intensive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn main() -> wry::Result<()> {
.body(data)
.map_err(Into::into)
})
.with_url("wrybench://localhost")?
.with_url("wrybench://localhost", None)?
.with_ipc_handler(handler)
.build()?;

Expand Down
2 changes: 1 addition & 1 deletion bench/tests/src/custom_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn main() -> wry::Result<()> {
.body(INDEX_HTML.into())
.map_err(Into::into)
})
.with_url("wrybench://localhost")?
.with_url("wrybench://localhost", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion bench/tests/src/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn main() -> wry::Result<()> {
};
let _webview = WebViewBuilder::new(window)
.unwrap()
.with_url(url)?
.with_url(url, None)?
.with_ipc_handler(handler)
.build()?;

Expand Down
2 changes: 1 addition & 1 deletion examples/custom_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn main() -> wry::Result<()> {
.map_err(Into::into)
})
// tell the webview to load the custom protocol
.with_url("wry://localhost")?
.with_url("wry://localhost", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_titlebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn main() -> wry::Result<()> {
let mut webview = Some(
WebViewBuilder::new(window)
.unwrap()
.with_html(HTML)?
.with_html(HTML, None)?
.with_ipc_handler(handler)
.with_accept_first_mouse(true)
.build()?,
Expand Down
2 changes: 1 addition & 1 deletion examples/detect_js_ecma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn main() -> wry::Result<()> {
.unwrap();
let _webview = WebViewBuilder::new(window)
.unwrap()
.with_html(HTML)?
.with_html(HTML, None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion examples/download_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() -> wry::Result<()> {
.with_title("Hello World")
.build(&event_loop)?;
let _webview = WebViewBuilder::new(window)?
.with_html(HTML)?
.with_html(HTML, None)?
.with_download_started_handler({
let proxy = proxy.clone();
move |uri: String, default_path: &mut PathBuf| {
Expand Down
2 changes: 1 addition & 1 deletion examples/dragndrop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Dropping files onto the following form is also possible:<br><br>
let window = WindowBuilder::new().build(&event_loop).unwrap();
let _webview = WebViewBuilder::new(window)
.unwrap()
.with_url(HTML)?
.with_url(HTML, None)?
.with_file_drop_handler(|_, data| {
println!("Window 1: {:?}", data);
false // Returning true will block the OS default behaviour.
Expand Down
2 changes: 1 addition & 1 deletion examples/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn main() -> wry::Result<()> {
.map_err(Into::into)
})
// tell the webview to load the custom protocol
.with_url("wry://localhost/examples/form.html")?
.with_url("wry://localhost/examples/form.html", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion examples/fullscreen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() -> wry::Result<()> {
.unwrap();
let _webview = WebViewBuilder::new(window)
.unwrap()
.with_url("https://browserbench.org/MotionMark1.2/")?
.with_url("https://browserbench.org/MotionMark1.2/", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() -> wry::Result<()> {
.with_title("Hello World")
.build(&event_loop)?;
let _webview = WebViewBuilder::new(window)?
.with_url("https://html5test.com")?
.with_url("https://html5test.com", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion examples/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() -> wry::Result<()> {
.map_err(Into::into)
})
// tell the webview to load the custom protocol
.with_url("wry://localhost")?
.with_url("wry://localhost", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
1 change: 1 addition & 0 deletions examples/multi_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fn main() -> wry::Result<()> {
<button onclick="window.ipc.postMessage('close')">Close current window</button>
<input oninput="window.ipc.postMessage(`change-title:${this.value}`)" />
"#,
None,
)
.unwrap()
.with_ipc_handler(handler)
Expand Down
2 changes: 1 addition & 1 deletion examples/navigation_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn main() -> wry::Result<()> {
.with_title("Hello World")
.build(&event_loop)?;
let _webview = WebViewBuilder::new(window)?
.with_url("http://neverssl.com")?
.with_url("http://neverssl.com", None)?
.with_navigation_handler(move |uri: String| {
let submitted = proxy.send_event(UserEvent::Navigation(uri.clone())).is_ok();

Expand Down
2 changes: 1 addition & 1 deletion examples/new_window_req_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn main() -> wry::Result<()> {
.with_title("Hello World")
.build(&event_loop)?;
let _webview = WebViewBuilder::new(window)?
.with_html(html)?
.with_html(html, None)?
.with_new_window_req_handler(move |uri: String| {
let submitted = proxy.send_event(UserEvent::NewWindow(uri.clone())).is_ok();

Expand Down
2 changes: 1 addition & 1 deletion examples/stream_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn main() -> wry::Result<()> {
.map_err(Into::into)
})
// tell the webview to load the custom protocol
.with_url("wry://localhost/examples/stream.html")?
.with_url("wry://localhost/examples/stream.html", None)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
1 change: 1 addition & 0 deletions examples/transparent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fn main() -> wry::Result<()> {
};
</script>
</html>"#,
None,
)?
.build()?;

Expand Down
5 changes: 4 additions & 1 deletion examples/user_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ fn main() -> wry::Result<()> {
.build(&event_loop)?;
let _webview = WebViewBuilder::new(window)?
.with_user_agent(&user_agent_string)
.with_url("https://www.whatismybrowser.com/detect/what-is-my-user-agent")?
.with_url(
"https://www.whatismybrowser.com/detect/what-is-my-user-agent",
None,
)?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! .with_title("Hello World")
//! .build(&event_loop)?;
//! let _webview = WebViewBuilder::new(window)?
//! .with_url("https://tauri.studio")?
//! .with_url("https://tauri.studio", None)?
//! .build()?;
//!
//! event_loop.run(move |event, _, control_flow| {
Expand Down

0 comments on commit de22b48

Please sign in to comment.