Skip to content

Conversation

@hymccord
Copy link

@hymccord hymccord commented Sep 7, 2025

This PR depends on #69 being accepted

  • feat(tab): use source window as ref to send handshake instead of setting a window var

Fixes: #15

Copilot AI review requested due to automatic review settings September 7, 2025 20:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves tab event sourcing by replacing the global window.newlyTabOpened variable approach with a more reliable method that uses the source window reference to identify tabs during handshake operations.

  • Removes global window.newlyTabOpened variable from tab creation and event handling
  • Enhances tab identification by using message source and searching tabs by ID or window reference
  • Updates function signatures to accept source parameter for better tab resolution

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/tab.js Removes setting of global window.newlyTabOpened variable during tab creation
src/event-listeners/postmessage.js Refactors event handlers to use source window reference instead of global variable for tab identification

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hymccord hymccord marked this pull request as draft September 7, 2025 20:38
@hymccord hymccord closed this Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If multiple child tabs are opened simultaneously, only one of them works correctly.

1 participant