-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Describe the bug
In dev mode, i.e. when running npm run tauri dev the method on_web_resource_request of the WundowBuilder seems to be ignored.
Reproduction
- Run
sh <(curl https://create.tauri.app/sh)on linux. - Choose npm as the package manager and
Vue-tsas the frontend framework. - Add the following setup hook to
src-tauri/src/main.rs:
.setup(|app| {
use tauri::WindowBuilder;
use tauri::WindowUrl;
let _window = WindowBuilder::new(
&app.handle(),
String::from("some_label"),
WindowUrl::App("index.html".into()),
).on_web_resource_request(move |request, response| {
println!("Received request: {:?}", request);
}).build();
Ok(())
})
- Run
npm run tauri devand see that the print statement is not being triggered. - Build the app via
npm run tauri buildand see that the print statement is being triggered when running the AppImage.
Expected behavior
I expect .on_web_resource_request() to also work in dev mode.
Platform and versions
Environment
› OS: Ubuntu 22.04 X64
› Node.js: 16.11.1
› npm: 8.0.0
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.64.0
› cargo: 1.64.0
› Rust toolchain: stable-x86_64-unknown-linux-gnu
Packages
› @tauri-apps/cli [NPM]: 1.2.1
› @tauri-apps/api [NPM]: 1.2.0
› tauri [RUST]: 1.2.1,
› tauri-build [RUST]: 1.2.1,
› tao [RUST]: 0.15.6,
› wry [RUST]: 0.22.5,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
› framework: Vue.js
App directory structure
├─ dist
├─ node_modules
├─ src-tauri
├─ src
├─ .vscode
└─ public
Stack trace
No response
Additional context
No response