kainsavage/HistoryBlock

Recently Closed Tabs not forgetting blacklist domains... sometimes

Closed this issue · 2 comments

I have not yet worked out how to reproduce this reliably, but it definitely affected FF56-58.

Closing several tabs to the same blacklisted domain in quick succession seems to be related.

Okay, this appears to be a crazy edge-case bug.

Steps to Recreate

  1. Visit blacklisted site
  2. Open blacklisted page from site in new tab
  3. Switch to new tab immediately
  4. Close new tab immediately
  5. View recently closed tab - see tab from steps 2-4 listed

What is Happening?

It seems that the API call browser.sessions.getRecentlyClosed({ maxResults: 1 }); runs into a race condition where the tab being closed is not yet added to the recently closed tabs array, and gives the most recently closed tab prior to the tab closed in step 4 above.

I really do not want to add a setTimeout() to the onTabRemoved() callback, but I don't see another way to get around this limitation in Firefox...