Bug 1488095 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Run this code in an extension:

  (async function() {
    let url = "http://example.com/";
    let {id: tabId} = await browser.tabs.create({url, discarded: true});
    let {id: windowId} = await browser.windows.create();
    let [tab] = await browser.tabs.move(tabId, {windowId, index: -1});
    console.assert(tab.discared, `Tab is still discarded`);
    await browser.windows.remove(windowId);
  })();

Result:

  [bug 1345098] Lazy browser prematurely inserted via 'messageManager' property access:
      getter@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#1989
      handleEvent@https://searchfox.org/mozilla-central/rev/c8483be/browser/components/extensions/parent/ext-browser.js#417
      addTab@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#2481
      addWebTab@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#2175
      adoptTab@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#3666
      move@https://searchfox.org/mozilla-central/rev/c8483be/browser/components/extensions/parent/ext-tabs.js#905
  Assertion failed: Tab is still discarded

Expected: the tab is not prematurely inserted, the assert passes.
Run this code in an extension:

  (async function() {
    let url = "http://example.com/";
    let {id: tabId} = await browser.tabs.create({url, discarded: true});
    let {id: windowId} = await browser.windows.create();
    let [tab] = await browser.tabs.move(tabId, {windowId, index: -1});
    console.assert(tab.discarded, `Tab is still discarded`);
    await browser.windows.remove(windowId);
  })();

Result:

  [bug 1345098] Lazy browser prematurely inserted via 'messageManager' property access:
      getter@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#1989
      handleEvent@https://searchfox.org/mozilla-central/rev/c8483be/browser/components/extensions/parent/ext-browser.js#417
      addTab@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#2481
      addWebTab@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#2175
      adoptTab@https://searchfox.org/mozilla-central/rev/c8483be/browser/base/content/tabbrowser.js#3666
      move@https://searchfox.org/mozilla-central/rev/c8483be/browser/components/extensions/parent/ext-tabs.js#905
  Assertion failed: Tab is still discarded

Expected: the tab is not prematurely inserted, the assert passes.

Back to Bug 1488095 Comment 0