Skip to content

[fake-browser] Tabs cannot be queried using active: true #121

@itakosu55

Description

@itakosu55

In https://github.com/aklinker1/webext-core/blob/3b4fc4778e02be15709271af87624c25bb139c49/packages/fake-browser/src/apis/tabs.ts

fakeBrowser.tabs.create({ active: true }) creates a new tab, but it doesn't actually update activeTabId variable,
so fakeBrowser.tabs.query({ active: true }) is unable to find the active tab.

When I run

fakeBrowser.reset();
await fakeBrowser.tabs.create({ active: true });
console.log(await fakeBrowser.tabs.query({}));

the following log is output:

[
  {
    id: 0,
    index: 0,
    highlighted: false,
    incognito: false,
    pinned: false,
    windowId: 0,
    active: false
  },
  {
    highlighted: false,
    incognito: false,
    index: 0,
    pinned: false,
    windowId: 0,
    id: 1,
    url: undefined,
    active: false
  }
]

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