mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 17:49:58 +00:00
Document extension messages and remove unnecessary messages/message data
This commit is contained in:
@@ -97,9 +97,7 @@ export function ensureInit(): Promise<TypedMessagePort<Message>> {
|
||||
function handleIncomingMessageToCast(message: Message) {
|
||||
switch (message.subject) {
|
||||
case "cast:initialized": {
|
||||
initializedBridgeInfo = message.data;
|
||||
|
||||
if (initializedBridgeInfo.isVersionCompatible) {
|
||||
if (message.data.isAvailable) {
|
||||
resolve(initializedBackgroundPort);
|
||||
} else {
|
||||
reject();
|
||||
|
||||
@@ -49,7 +49,7 @@ eventMessaging.page.addListener(async message => {
|
||||
// Call page script/framework API script's init function
|
||||
const initFn = _window.__onGCastApiAvailable;
|
||||
if (initFn && typeof initFn === "function") {
|
||||
initFn(message.data.isVersionCompatible);
|
||||
initFn(message.data.isAvailable);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -143,11 +143,6 @@ export default class {
|
||||
* and data needed to create cast API objects is sent.
|
||||
*/
|
||||
case "cast:sessionCreated": {
|
||||
// Notify background to close UI
|
||||
eventMessaging.page.sendMessage({
|
||||
subject: "main:closeReceiverSelector"
|
||||
});
|
||||
|
||||
const status = message.data;
|
||||
const receiverDevice = this.#receiverDevices.get(
|
||||
status.receiverId
|
||||
|
||||
Reference in New Issue
Block a user