diff --git a/src/csui/src/PlayerUiPanels/VideoSettings.vue b/src/csui/src/PlayerUiPanels/VideoSettings.vue index 2c5eef4..cb7c125 100644 --- a/src/csui/src/PlayerUiPanels/VideoSettings.vue +++ b/src/csui/src/PlayerUiPanels/VideoSettings.vue @@ -309,6 +309,8 @@ export default { BrowserDetect.runtime.openOptionsPage(); }, execAction(command) { + const cmd = JSON.parse(JSON.stringify(command)); + window.parent.postMessage(cmd, '*'); // this.eventBus?.send(command.action, command.arguments); }, parseShortcut(command) { diff --git a/src/csui/src/ui-libs/ExecAction.js b/src/csui/src/ui-libs/ExecAction.js index ac5a8e4..c73980b 100644 --- a/src/csui/src/ui-libs/ExecAction.js +++ b/src/csui/src/ui-libs/ExecAction.js @@ -15,7 +15,6 @@ class ExecAction { async exec(action, scope, frame, useBus) { - console.log('execing actioN!'); for (var cmd of action.cmd) { if (!scope || scope === 'page') { const message = { @@ -29,6 +28,7 @@ class ExecAction { if (useBus) { // todo: postMessage out of the iframe! // window.ultrawidify.bus.sendMessage(message.cmd, message); + window.parent.sendMessage(message.cmd, message); } else { Comms.sendMessage(message); } @@ -49,8 +49,9 @@ class ExecAction { // this hopefully delays settings.save() until current crops are saved on the site // and thus avoid any fucky-wuckies if (useBus) { - // todo: postMessage out of the iframe! + // todo: postMessage out of the iframe! // window.ultrawidify.bus.sendMessage(message.cmd, message); + window.parent.sendMessage(message.cmd, message); } else { await Comms.sendMessage(message); } diff --git a/src/ext/lib/video-data/PlayerData.ts b/src/ext/lib/video-data/PlayerData.ts index c4e5a85..fabb10f 100644 --- a/src/ext/lib/video-data/PlayerData.ts +++ b/src/ext/lib/video-data/PlayerData.ts @@ -95,7 +95,7 @@ class PlayerData { this.element = this.getPlayer(); // this.notificationService = new PlayerNotificationUi(this.element, this.settings, this.eventBus); - this.ui = new UI('ultrawidifyUi', {parentElement: this.element}); + this.ui = new UI('ultrawidifyUi', {parentElement: this.element, eventBus: this.eventBus}); // this.ui.init(); this.dimensions = undefined;