Plugins are currently implemented as an external website embedded in an
iframe which is invoked by a shortcut or slash command.
This has a number of advantages:
- Native Plugins can run automatically and do not have have to be invoked manually via shortcut or slash command, e.g. expand
→RemNote can provide a set of hooks (
addTag, …) on which a plugin can subscribe and perform actions, or listen to native events themselves (
- Native Plugins can modify and control RemNote directly, e.g. add a button to the sidebar or focus a different rem. (See also Feature Policies for Plugin IFrames).
- Native Plugins can work offline and run fast. There is on external website which has to load first. This makes small actions like adding a tag more interactive.
Related: RoamResearch has this with
roam/js (see this for some examples ROAM JS EXTENSIONS - September 2020 Releases! - YouTube) and I also like Trilium’s API: Scripts · zadam/trilium Wiki · GitHub
A workaround is to use a browser extension for user scripts but when I tried to make a pane switcher it did not work because I could not even click on stuff (React handles events internally).