Connect popup (video settings only so far) to content script logic
This commit is contained in:
parent
7fefe255ea
commit
89168b643c
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user