Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] MacOS after updating to tauri version 1.2, the launch of the local page with parameters stopped working #5581

Closed
Bukmopbl4 opened this issue Nov 8, 2022 · 10 comments
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Bukmopbl4
Copy link

Describe the bug

new window.__TAURI__.window.WebviewWindow('test', {url: 'index.html?param=1'})

on version 1.2 this example stopped working. The desired page opens only without passing parameters.

Reproduction

No response

Expected behavior

No response

Platform and versions

Environment
› OS: Mac OS 13.0.0 X64
› Node.js: 16.17.1
› npm: 8.15.0
› pnpm: Not installed!
› yarn: Not installed!
› rustup: 1.25.1
› rustc: 1.64.0
› cargo: 1.64.0
› Rust toolchain: stable-x86_64-apple-darwin

Packages
WARNING: no lock files found, defaulting to npm
› @tauri-apps/cli [NPM]: 1.2.0
› @tauri-apps/api [NPM]: Not installed!
› tauri [RUST]: 1.2.0,
› tauri-build [RUST]: 1.2.0,
› tao [RUST]: 0.15.0,
› wry [RUST]: 0.22.0,

App
› build-type: bundle
› CSP: unset
› distDir: ../src
› devPath: ../src
package.json not found

App directory structure
├─ src-tauri
├─ .git
├─ .vscode
└─ src

Stack trace

No response

Additional context

No response

@Bukmopbl4 Bukmopbl4 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Nov 8, 2022
@FabianLars
Copy link
Member

Not sure if this is related to #5582 but it seems to be macos only too 🤔
Or maybe i'm testing it wrong, i only check window.location.href in the new window and this still includes the query param.

@FabianLars
Copy link
Member

ah wait, i didn't read the title carefully enough - can you explain your code a bit more (or show it) ? It seems to work fine for me on linux/win10

@Bukmopbl4 Bukmopbl4 changed the title [bug] Win10/MacOS after updating to tauri version 1.2, the launch of the local page with parameters stopped working [bug] MacOS after updating to tauri version 1.2, the launch of the local page with parameters stopped working Nov 8, 2022
@Bukmopbl4
Copy link
Author

ah wait, i didn't read the title carefully enough - can you explain your code a bit more (or show it) ? It seems to work fine for me on linux/win10

win 10 works. Only macOS not working. The required html with parameters does not open at all.

@lucasfernog
Copy link
Member

I tried this and it works fine on macOS 13. Can you give us more information? Is this on dev or on production? Do you see any errors in the console? What if you try to check for errors when creating the window:

const webview = new window.__TAURI__.window.WebviewWindow('test', {url: 'index.html?param=1'})
webview.once('tauri://error', function (e) {
  console.error('error creating webview', e)    
})

@Bukmopbl4
Copy link
Author

Bukmopbl4 commented Nov 9, 2022

it works fine on macOS 13

it works fine for index.html, but a trying open second window with params like const webview = new window.__TAURI__.window.WebviewWindow('test', {url: 'monitorIdentify.html?monitor=1'}) for open new window en each monitor with number from url params and window was created but not showing my html and reload page with index.html content.
In DEV - page reload
In PROD - works!

@Bukmopbl4
Copy link
Author

Also, if links to resources with parameters were used, then such files are not loaded into the DEV too, but if you remove the parameters, then everything works right away. Ex: url(../fonts/font-awesome/fontawesome-webfont.woff?v=4.5.0)

@lucasfernog
Copy link
Member

Ok that might be related to tauri-apps/wry#706, we'll investigate further.

@Bukmopbl4
Copy link
Author

The problem hasn't been fixed yet.

@pmgl
Copy link

pmgl commented Feb 9, 2023

I think this may be related, I am on macOS too: static images won't load in the webview whenever the path includes a query parameter. Example from the webview devtools console in my Tauri app:

var img = new Image ;
img.src = "/sprites/background.png?v=42" ;

Image will not load ; if I remove the query parameter "?v=42", image will load successfully.

@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 26, 2023
@FabianLars
Copy link
Member

can someone confirm whether this is still an issue in v2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
Status: 📬Proposal
Development

No branches or pull requests

4 participants