mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-09 09:09:58 +00:00
Clean history after receiver selector popup is opened
This commit is contained in:
@@ -12,6 +12,8 @@ import { getWindowCenteredProps, WindowCenteredProps } from "../../lib/utils";
|
||||
import { Message, Receiver } from "../../types";
|
||||
|
||||
|
||||
const POPUP_URL = browser.runtime.getURL("ui/popup/index.html");
|
||||
|
||||
export default class PopupReceiverSelector
|
||||
extends TypedEventTarget<ReceiverSelectorEvents>
|
||||
implements ReceiverSelector {
|
||||
@@ -46,6 +48,9 @@ export default class PopupReceiverSelector
|
||||
* window script.
|
||||
*/
|
||||
browser.runtime.onConnect.addListener(port => {
|
||||
// Don't polute history
|
||||
browser.history.deleteUrl({ url: POPUP_URL });
|
||||
|
||||
if (port.name !== "popup") {
|
||||
return;
|
||||
}
|
||||
@@ -116,8 +121,8 @@ export default class PopupReceiverSelector
|
||||
}
|
||||
|
||||
const popup = await browser.windows.create({
|
||||
url: "ui/popup/index.html"
|
||||
, type: "popup"
|
||||
url: POPUP_URL
|
||||
, type: "detached_panel"
|
||||
, ...centeredProps
|
||||
});
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
"page": "ui/options/index.html"
|
||||
}
|
||||
, "permissions": [
|
||||
"menus"
|
||||
"history"
|
||||
, "menus"
|
||||
, "nativeMessaging"
|
||||
, "storage"
|
||||
, "tabs"
|
||||
|
||||
Reference in New Issue
Block a user