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

Firefox popout closure work-around #69

Open
da2x opened this issue Aug 14, 2018 · 2 comments
Open

Firefox popout closure work-around #69

da2x opened this issue Aug 14, 2018 · 2 comments
Milestone

Comments

@da2x
Copy link
Contributor

da2x commented Aug 14, 2018

// 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

@DominicMaas DominicMaas added this to the 1.0.6 milestone Aug 20, 2018
@DominicMaas
Copy link
Owner

browser.tabs.update({active: true}); does not appear to be valid? (at least TypeScript complains about needing two arguments, tabId and updateProperties). Seems to be happy with chrome.tabs.update({active: true}); for Chrome.

@da2x
Copy link
Contributor Author

da2x commented Oct 10, 2018

You don’t need to specify tab id here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants