Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Firefox popout closure work-around #69

@da2x

Description

@da2x
// COMPAT: popouts can’t be window.close() on Firefox for Android, Moving focus
// back to the active tab (the popout is never active) will close the popout.
function closePopOut()
{
  browser.runtime.getPlatformInfo().then(
    function(platformInfo)
    {
      if (platformInfo.os == 'android')
        browser.tabs.update({active: true});
      else
        window.close();
    },
    window.close
  );
}

https://www.ctrl.blog/entry/firefox-browseraction-close-popout-android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions