Skip to content

ElectronChromeExtensions addTab always selects the tab, even if adding a background tab #159

@GramboStorm

Description

@GramboStorm

In my (own) electron browser I'm using electron-chrome-extensions.

We can create background tabs (i.e. leaving the current tab still selected) and then call the addTab in ElectronChromeExtensions class to publish that it now exists.

The problem is that this will ALWAYS be immediately selected within ElectronChromeExtensions, even though it was opened in the background. This is because the addTab emits "tab-added" which is listened to by observeTab which itself calls onActivated with the new tab id.
This in turn then calls the selectTab callback function defined when creating the new ElectronChromeExtensions (not sure if this should really be called when adding a tab anyway? but thats a different discussion)

Request: There should be a way to call addTab which an option to say its opening in the background so that it doesn't affect the currently selected tag

Currently the workaround is to immediately call the ElectronChromeExtensions call function 'selectTab' with the old tabid immediately after adding it but this can cause extensions the activate a couple of times unnecessarily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions