tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Anchors with target="_blank" inside of an iframe are not working

Open toppermitz opened this issue 1 year ago • 2 comments

Describe the bug

If I have a anchor with target="_blank" inside an iframe nothing happen when I click.

anchors outside iframe open in a normal way (new page on my default browser)

Reproduction

I make a small repo to reproce this bug

https://github.com/toppermitz/tauri-iframe-bug

Just click on link inside the iframe and nothing happen.

Expected behavior

When I click in an anchor inside an iframe, the anchor href must be loaded on my default browser.

Full tauri info output

1.6.7

[✔] Environment
    - OS: Mac OS 14.5.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.12.0
    - pnpm: 9.1.3
    - yarn: 1.22.19
    - npm: 10.5.0
    - bun: 1.0.17

[-] Packages
    - tauri [RUST]: 1.6.7
    - tauri-build [RUST]: 1.5.2
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 1.5.14

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../src
    - devPath: ../src


For 2.0.0-beta.22

[✔] Environment
    - OS: Mac OS 14.5.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.12.0
    - pnpm: 9.1.3
    - yarn: 1.22.19
    - npm: 10.5.0
    - bun: 1.0.17

[-] Packages
    - tauri [RUST]: 2.0.0-beta.22
    - tauri-build [RUST]: 2.0.0-beta.17
    - wry [RUST]: 0.40.0
    - tao [RUST]: 0.28.0
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.19

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../src

Stack trace

No response

Additional context

This problem occours in 1.6.7 and 2.0-beta version

toppermitz avatar May 29 '24 19:05 toppermitz

Have you checked permissions? Since tauri v2, you must provide permissions via capabilities.

In the src-tauri/capabilities/xxx.json:

{
  "$schema": "../gen/schemas/desktop-schema.json",
  "identifier": "application-capability",
  "description": "Capability for the application",
  "windows": ["*"],
  "permissions": ["shell:allow-open"]
}

AcrylicShrimp avatar Jun 11 '24 17:06 AcrylicShrimp

I double check the permissions .

if you check my demo project the permission is granted but inside an iframe nothing happen

toppermitz avatar Jun 12 '24 02:06 toppermitz

Has the last issue been resolved? @toppermitz

tw93 avatar Jan 08 '25 08:01 tw93

Has the last issue been resolved? @toppermitz

Sjj1024 avatar Mar 05 '25 06:03 Sjj1024

@Sjj1024 and @tw93 this issue still there.

Using this repo https://github.com/toppermitz/tauri-iframe-bug

Update to version 2.3.1

And links on iframe still do nothing.

toppermitz avatar Mar 05 '25 09:03 toppermitz

@Sjj1024 and @tw93 this issue still there.

Using this repo https://github.com/toppermitz/tauri-iframe-bug

Update to version 2.3.1

And links on iframe still do nothing.

OK,thank you

Sjj1024 avatar Mar 06 '25 02:03 Sjj1024