Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Added custom window event #39

Merged
merged 2 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ function onReady () {
break;
case consts.eventNames.windowCmdUpdateCustomOptions:
windowOptions[json.targetID] = json.windowOptions
client.write(json.targetID, consts.eventNames.windowEventUpdatedCustomOptions, json.windowOptions)
break;
case consts.eventNames.windowCmdWebContentsExecuteJavascript:
elements[json.targetID].webContents.executeJavaScript(json.code).then(() => client.write(json.targetID, consts.eventNames.windowEventWebContentsExecutedJavaScript));
Expand Down
3 changes: 2 additions & 1 deletion src/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ module.exports = {
windowEventShow: "window.event.show",
windowEventUnmaximize: "window.event.unmaximize",
windowEventUnresponsive: "window.event.unresponsive",
windowEventWebContentsExecutedJavaScript: "window.event.web.contents.executed.javascript"
windowEventWebContentsExecutedJavaScript: "window.event.web.contents.executed.javascript",
windowEventUpdatedCustomOptions: "window.event.updated.custom.options"
},
targetIds: {
app: 'app',
Expand Down