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

iframe with fragment in src don't render #1943

Closed
olegshilov opened this issue Jun 3, 2021 · 3 comments
Closed

iframe with fragment in src don't render #1943

olegshilov opened this issue Jun 3, 2021 · 3 comments

Comments

@olegshilov
Copy link
Contributor

olegshilov commented Jun 3, 2021

Describe the bug
The problem is when iframe src includes a URI fragment, like #something, it won't load when you try to load it from disk.

To Reproduce
Minimal reproducible example placed here:
https://github.com/olegshilov/tauri-testing/tree/iframe-issue
Steps to reproduce:

  • clone
  • install dependencies
  • run yarn start or yarn build

Expected behavior
Every iframe with fragments in URL must be rendered correctly

Screenshots
image

Platform and Versions (please complete the following information):

❯ yarn tauri info
 app:spawn Running "/Users/olegshilov/Documents/tauri-testing/.yarn/unplugged/@tauri-apps-cli-npm-1.0.0-beta.2-71cdee115b/node_modules/@tauri-apps/cli/bin/tauri-cli tauri info" +0ms


Operating System - Mac OS, version 11.4.0 X64

Node.js environment
  Node.js - 15.7.0
  @tauri-apps/cli - 1.0.0-beta.1
  @tauri-apps/api - Not installed

Global packages
  npm - 7.5.3
  yarn - 3.0.0-rc.2.git.20210514.hash-4d53b9eb

Rust environment
  rustc - 1.52.1
  cargo - 1.52.0

App directory structure
/.yarn
/app
/src-tauri
/.git

App
  tauri.rs - 1.0.0-beta.1
build-type - bundle
CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - ../app
devPath - ../app
@shirakaba
Copy link

shirakaba commented Jun 4, 2021

I don't think this is a Tauri-specific issue, but I decided to try it just through a local Apache web server using Safari 14.1.1 on macOS 10.15.7 out of interest.

I made only three changes to your https://github.com/olegshilov/tauri-testing/tree/iframe-issue/app:

  • In index.html, I changed the start of each path from /iframe.html to ./iframe.html (because I was in a subdirectory of the web server).
  • I added the HTML to iframe.html to print out the URLs:
    <p>location.href: <span id="loc"></span></p>
    <script>document.getElementById("loc").textContent = location.href</script>
  • In index.html, I also increased the iframe width to 500 to see the full URL:

image

Curiously it works fully over Apache. Can't immediately explain why it's behaving different in the Tauri context.

@shirakaba
Copy link

Also works over the file system (rather than a web server) with Safari:

image

@olegshilov
Copy link
Contributor Author

@shirakaba hi. it's Tauri-specific issue because we detect the place where it happened

.split('?')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants