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();
|
BrowserDetect.runtime.openOptionsPage();
|
||||||
},
|
},
|
||||||
execAction(command) {
|
execAction(command) {
|
||||||
|
const cmd = JSON.parse(JSON.stringify(command));
|
||||||
|
window.parent.postMessage(cmd, '*');
|
||||||
// this.eventBus?.send(command.action, command.arguments);
|
// this.eventBus?.send(command.action, command.arguments);
|
||||||
},
|
},
|
||||||
parseShortcut(command) {
|
parseShortcut(command) {
|
||||||
|
@ -15,7 +15,6 @@ class ExecAction {
|
|||||||
|
|
||||||
|
|
||||||
async exec(action, scope, frame, useBus) {
|
async exec(action, scope, frame, useBus) {
|
||||||
console.log('execing actioN!');
|
|
||||||
for (var cmd of action.cmd) {
|
for (var cmd of action.cmd) {
|
||||||
if (!scope || scope === 'page') {
|
if (!scope || scope === 'page') {
|
||||||
const message = {
|
const message = {
|
||||||
@ -29,6 +28,7 @@ class ExecAction {
|
|||||||
if (useBus) {
|
if (useBus) {
|
||||||
// todo: postMessage out of the iframe!
|
// todo: postMessage out of the iframe!
|
||||||
// window.ultrawidify.bus.sendMessage(message.cmd, message);
|
// window.ultrawidify.bus.sendMessage(message.cmd, message);
|
||||||
|
window.parent.sendMessage(message.cmd, message);
|
||||||
} else {
|
} else {
|
||||||
Comms.sendMessage(message);
|
Comms.sendMessage(message);
|
||||||
}
|
}
|
||||||
@ -49,8 +49,9 @@ class ExecAction {
|
|||||||
// this hopefully delays settings.save() until current crops are saved on the site
|
// this hopefully delays settings.save() until current crops are saved on the site
|
||||||
// and thus avoid any fucky-wuckies
|
// and thus avoid any fucky-wuckies
|
||||||
if (useBus) {
|
if (useBus) {
|
||||||
// todo: postMessage out of the iframe!
|
// todo: postMessage out of the iframe!
|
||||||
// window.ultrawidify.bus.sendMessage(message.cmd, message);
|
// window.ultrawidify.bus.sendMessage(message.cmd, message);
|
||||||
|
window.parent.sendMessage(message.cmd, message);
|
||||||
} else {
|
} else {
|
||||||
await Comms.sendMessage(message);
|
await Comms.sendMessage(message);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ class PlayerData {
|
|||||||
this.element = this.getPlayer();
|
this.element = this.getPlayer();
|
||||||
|
|
||||||
// this.notificationService = new PlayerNotificationUi(this.element, this.settings, this.eventBus);
|
// 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.ui.init();
|
||||||
|
|
||||||
this.dimensions = undefined;
|
this.dimensions = undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user