mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-10 04:46:07 -08:00
feat(plugins): add JavaScript plugin system with overlay panel (#303)
This commit is contained in:
1 parent
90fc7cf940
commit
a9a4c4f083
110 files changed
+5897
-344
No files matched your search
@@ -50,6 +50,7 @@ const SESSION_ACTION_IDS: SessionActionId[] = [
|
||||
'replayCurrentSubtitle',
|
||||
'playNextSubtitle',
|
||||
'cycleRuntimeOption',
|
||||
'runPluginAction',
|
||||
];
|
||||
|
||||
const RUNTIME_OPTION_IDS: RuntimeOptionId[] = [
|
||||
@@ -111,6 +112,15 @@ function parseSessionActionPayload(
|
||||
};
|
||||
}
|
||||
|
||||
if (actionId === 'runPluginAction') {
|
||||
if (!isObject(value)) return null;
|
||||
if (Object.keys(value).some((key) => key !== 'pluginActionId')) return null;
|
||||
if (typeof value.pluginActionId !== 'string' || !value.pluginActionId.includes('/')) {
|
||||
return null;
|
||||
}
|
||||
return { pluginActionId: value.pluginActionId };
|
||||
}
|
||||
|
||||
return value === undefined ? undefined : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user