mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 10:39:57 +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:
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as cast from "./cast";
|
||||
|
||||
import { CAST_FRAMEWORK_SCRIPT_URL } from "../endpoints";
|
||||
import { CAST_FRAMEWORK_SCRIPT_URL } from "../lib/endpoints";
|
||||
import { loadScript } from "../lib/utils";
|
||||
import { onMessage } from "./eventMessageChannel";
|
||||
|
||||
@@ -13,6 +13,10 @@ if (!_window.chrome) {
|
||||
_window.chrome = {};
|
||||
}
|
||||
|
||||
|
||||
// Remove private APIs
|
||||
delete cast._requestSession;
|
||||
|
||||
// Create page-accessible API object
|
||||
_window.chrome.cast = cast;
|
||||
|
||||
@@ -61,7 +65,6 @@ if (document.currentScript) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onMessage(message => {
|
||||
switch (message.subject) {
|
||||
case "shim:/initialized": {
|
||||
|
||||
Reference in New Issue
Block a user