mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 09:39:58 +00:00
Restructure background script (#70)
Splits some background script functionality into separate modules: - Receiver selector handling is moved to ./SelectorManager. - Status bridge handling is moved to ./StatusManager. - Menu creation and updates are handled in ./createMenus. - Shim creation is handled in ./createShim. TypedEventTarget allows EventTarget-derived classes to export typed events. Options type definition is moved to ./lib/options, module assumes more responsibility for update handling and provides a "changed" event. Private cast._requestSession method allows bypassing receiver selector.
This commit is contained in:
@@ -1,29 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
import { Options } from "./lib/options";
|
||||
import { ReceiverSelectorType } from "./receiver_selectors";
|
||||
|
||||
export interface Options {
|
||||
bridgeApplicationName: string;
|
||||
mediaEnabled: boolean;
|
||||
mediaSyncElement: boolean;
|
||||
mediaStopOnUnload: boolean;
|
||||
localMediaEnabled: boolean;
|
||||
localMediaServerPort: number;
|
||||
mirroringEnabled: boolean;
|
||||
mirroringAppId: string;
|
||||
receiverSelectorType: ReceiverSelectorType;
|
||||
|
||||
// TODO: Implement
|
||||
receiverSelectorCloseIfFocusLost: boolean;
|
||||
receiverSelectorWaitForConnection: boolean;
|
||||
|
||||
userAgentWhitelistEnabled: boolean;
|
||||
userAgentWhitelist: string[];
|
||||
|
||||
[key: string]: Options[keyof Options];
|
||||
}
|
||||
|
||||
const options: Options = {
|
||||
export default {
|
||||
bridgeApplicationName: APPLICATION_NAME
|
||||
, mediaEnabled: true
|
||||
, mediaSyncElement: false
|
||||
@@ -39,6 +20,4 @@ const options: Options = {
|
||||
, userAgentWhitelist: [
|
||||
"https://www.netflix.com/*"
|
||||
]
|
||||
};
|
||||
|
||||
export default options;
|
||||
} as Options;
|
||||
|
||||
Reference in New Issue
Block a user