How to prevent extension popup window from showing in Recently Closed Windows menu

My WebExtension removes the URL of its extension popup windows, opened via browser.windows.create(), by calling browser.history.deleteUrl(); doing so avoids cluttering the user’s browser history. But this doesn’t remove the extension popup window from the Recently Closed Windows menu. Is there a way to do that?

This might be what you’re looking for: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/sessions/forgetClosedWindow