aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/api.js4
-rw-r--r--ext/fg/js/frontend.js8
2 files changed, 8 insertions, 4 deletions
diff --git a/ext/fg/js/api.js b/ext/fg/js/api.js
index 2294cb8b..b0746b85 100644
--- a/ext/fg/js/api.js
+++ b/ext/fg/js/api.js
@@ -49,8 +49,8 @@ function apiAudioGetUrl(definition, source, optionsContext) {
return utilInvoke('audioGetUrl', {definition, source, optionsContext});
}
-function apiCommandExec(command) {
- return utilInvoke('commandExec', {command});
+function apiCommandExec(command, params) {
+ return utilInvoke('commandExec', {command, params});
}
function apiScreenshotGet(options) {
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 45d24329..e854f74e 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -237,8 +237,8 @@ class Frontend {
const handlers = Frontend.runtimeMessageHandlers;
if (handlers.hasOwnProperty(action)) {
const handler = handlers[action];
- handler(this, params);
- callback();
+ const result = handler(this, params);
+ callback(result);
}
}
@@ -576,5 +576,9 @@ Frontend.runtimeMessageHandlers = {
popupSetVisibleOverride: (self, {visible}) => {
self.popup.setVisibleOverride(visible);
+ },
+
+ getUrl: () => {
+ return {url: window.location.href};
}
};