Skip to content

[bug] window.__TAURI__ doesn't get injected if the Entry Url (devPath/distPath) is not an origin url (ie: entry url is a subpage) #4414

@imadbz

Description

@imadbz

Describe the bug

if we specify the url to be an origin (ex: http://localhost:3000), global tauri gets injected in the window.
image

if we specify the url to be an inner page (ex: http://localhost:3000/about), global tauri doesn't get injected.
image

Reproduction

specify devPath to an inner page. (ex: http://localhost:3000/about)
run the app
inspect and check for window.__TAURI vars

Expected behavior

No response

Platform and versions

Environment
  › OS: Mac OS 12.4.0 X64
  › Node.js: 16.15.0
  › npm: 8.10.0
  › pnpm: 6.11.0
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-aarch64-apple-darwin 

Packages
Error running CLI: only one package mangager should be used, but found npm and yarn
please remove unused package manager lock files
➜  devutil git:(master) ✗ npm run tauri info

> devutil@0.0.0 tauri
> tauri "info"


Environment
  › OS: Mac OS 12.4.0 X64
  › Node.js: 16.15.0
  › npm: 8.10.0
  › pnpm: 6.11.0
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-aarch64-apple-darwin 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0
  › @tauri-apps/api [NPM]: 1.0.1
  › tauri [RUST]: 1.0.0,
  › tauri-build [RUST]: 1.0.0,
  › tao [RUST]: 0.11.2,
  › wry [RUST]: 0.18.3,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:3000/about
  › framework: Vue.js

App directory structure
  ├─ node_modules
  ├─ public
  ├─ src-tauri
  ├─ .git
  └─ src

Stack trace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions