TimelineExtension icon indicating copy to clipboard operation
TimelineExtension copied to clipboard

Firefox popout closure work-around

Open da2x opened this issue 6 years ago • 2 comments

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

da2x avatar Aug 14 '18 15:08 da2x

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.

DominicMaas avatar Sep 04 '18 06:09 DominicMaas

You don’t need to specify tab id here.

da2x avatar Oct 10 '18 01:10 da2x