mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-09 17:19:59 +00:00
Move menu IDs to reduce bundle size + misc config fixes
This commit is contained in:
@@ -5,23 +5,15 @@ import messaging, { Port, Message } from "../messaging";
|
||||
import options from "../lib/options";
|
||||
|
||||
import { TypedEventTarget } from "../lib/TypedEventTarget";
|
||||
import { SessionRequest } from "../cast/sdk/classes";
|
||||
import {
|
||||
ReceiverDevice,
|
||||
ReceiverSelectionActionType,
|
||||
ReceiverSelectorMediaType
|
||||
ReceiverSelectorMediaType,
|
||||
ReceiverSelectorPageInfo
|
||||
} from "../types";
|
||||
|
||||
const POPUP_URL = browser.runtime.getURL("ui/popup/index.html");
|
||||
|
||||
/** Info about sender page context. */
|
||||
export interface ReceiverSelectorPageInfo {
|
||||
url: string;
|
||||
tabId: number;
|
||||
frameId: number;
|
||||
sessionRequest?: SessionRequest;
|
||||
}
|
||||
|
||||
export interface ReceiverSelectionCast {
|
||||
actionType: ReceiverSelectionActionType.Cast;
|
||||
receiverDevice: ReceiverDevice;
|
||||
|
||||
@@ -30,9 +30,6 @@ let menuIdCastMedia: MenuId;
|
||||
let menuIdWhitelist: MenuId;
|
||||
let menuIdWhitelistRecommended: MenuId;
|
||||
|
||||
export const menuIdPopupCast = "popup_cast";
|
||||
export const menuIdPopupStop = "popup_stop";
|
||||
|
||||
/** Match patterns for the whitelist option menus. */
|
||||
const whitelistChildMenuPatterns = new Map<MenuId, string>();
|
||||
|
||||
@@ -79,12 +76,12 @@ export async function initMenus() {
|
||||
// Popup context menus
|
||||
const popupUrlPattern = `${browser.runtime.getURL("ui/popup")}/*`;
|
||||
browser.menus.create({
|
||||
id: menuIdPopupCast,
|
||||
id: "popup_cast",
|
||||
title: _("popupCastButtonTitle"),
|
||||
documentUrlPatterns: [popupUrlPattern]
|
||||
});
|
||||
browser.menus.create({
|
||||
id: menuIdPopupStop,
|
||||
id: "popup_stop",
|
||||
title: _("popupStopButtonTitle"),
|
||||
documentUrlPatterns: [popupUrlPattern]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user