The default bug view has changed. See this FAQ.

Implement browser.sessions.forgetClosedTab and forgetClosedWindow




WebExtensions: General
2 months ago
16 days ago


(Reporter: Kain, Unassigned)


52 Branch

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [design-decision-approved][sessions]triaged)



2 months ago
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170123004004

Steps to reproduce:

I attempted to update my XPCOM extension ( to Web Extension and found some of the core APIs missing.

Actual results:

Specifically, HistoryBlock relies on `nsIBrowserHistory.removePagesFromHost` as well as `nsISessionStore.forgetClosedTab` and `nsISessionStore.forgetClosedWindow` (currently, only the former, but I would like both).

Expected results:

It would be extremely helpful if the `sessions` Web Extension API included `forgetClosedTab` and `forgetClosedWindow`, and if the `history` Web Extension API included `removePagesFromHost` (though, I can probably get by with the existing `deleteUrl`... maybe).

Comment 1

2 months ago
For some context on HistoryBlock (

HistoryBlock allows users to store hashed hostnames in a blacklist, and when a user visits a blacklisted website the history entries are immediately purged. Additionally, if a tab is closed (and hopefully in an upcoming version, if a window is closed) containing a blacklisted hostname, then it is purged from the 'Recently Closed Tabs/Windows' list.

Additionally, cache entries appear to also be purged, though there is no API call for that other than via the history manager's `removePagesFromHost`.
Whiteboard: [design-decision-needed]

Comment 2

2 months ago
I have created an experimental implementation of the two session APIs I require:

Comment 3

2 months ago
Additionally, after some experimentation, I do not require `removePagesFromHost` as `browser.history.deleteUrl` is sufficient.

Comment 4

18 days ago
This has been added to the March 7 WebExtensions Triage meeting agenda. 

Kain, this proposal has been approved, and we think it makes sense to implement these functions directly in the sessions API, rather than as an experiment. Is this something you are interested in working on?
Assignee: nobody → kain_savage
Component: WebExtensions: Untriaged → WebExtensions: General
Ever confirmed: true
Flags: needinfo?(kain_savage)
Priority: -- → P5
Summary: WebExtension nsISessionStore-equivalent APIs → Implement browser.sessions.forgetClosedTab and forgetClosedWindow
Whiteboard: [design-decision-needed] → [design-decision-approved][sessions]triaged

Comment 6

16 days ago
Bob, I would love to work on this directly, but my schedule has gotten extremely busy of late (notice, I have not even submitted the pull request for my experiment yet and I said I would do that two weeks ago... apologies).

If there is no one else willing/able to work on it, I would happily donate some time as it becomes available to me, but I do not know when that will be.
Flags: needinfo?(kain_savage)
Thanks for the update, Kain. I will unassign you in case someone else comes along who wants to work on it, but when you do find the time please feel free to pick it up where you left off.
Assignee: kain_savage → nobody
You need to log in before you can comment on or make changes to this bug.