Skip to content

[bug] getAll() doesn't include windows created in JavaScript. #3297

@XuluWarrior

Description

@XuluWarrior

Describe the bug

If I create a new window in the main WebView, the array returned bygetAll() doesn't include the new window.

Reproduction

  1. Include the following code in the WebView
  import { window as tauriWindow } from '@tauri-apps/api';
  
  const w = new tauriWindow.WebviewWindow('child', {
    title: 'Child',
    resizable: true,
    width: 700,
    height: 600,
    url: "child.html"
  });
  setTimeout(() => console.log('all', tauriWindow.getAll()), 2000); // Wait a bit in case it takes time for windows to be created/updated
  console.log(tauriWindow.getAll());
  1. The output to console only includes the main window.

Expected behavior

I would expect the array returned by getAll() to contain both the main and child windows.

Platform and versions

Operating System - Mac OS, version 11.6.2 X64

Node.js environment
  Node.js - 14.18.2
  @tauri-apps/cli - 1.0.0-beta.10
  @tauri-apps/api - 1.0.0-beta.8

Global packages
  npm - 6.14.15
  yarn - 1.22.17

Rust environment
  rustc - 1.57.0
  cargo - 1.57.0

App directory structure
/node_modules
/public
/src-tauri
/.git
/.idea
/src

App
  tauri.rs - 1.0.0-beta.8 (I am actually running { git = "https://github.com/tauri-apps/tauri", branch = "next" } )
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../build
  devPath - http://localhost:3000
  framework - React

Stack trace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions