Modules
Open Handlers
Intercept double-clicks to open files in a custom viewer or behaviour.
Open handlers let a module claim the double-click (open) behaviour for a set of
items — e.g. open .pdf files in a custom viewer. You declare a serializable
match and register the runner in setup.
export default defineModule({
id: "author.pdf-viewer",
permissions: ["navigation"],
openHandlers: [
{
id: "author.pdf-viewer.open-pdf",
priority: 10, // higher wins; core defaults sit at 0
match: { extensions: ["pdf"] }, // serializable matcher
handler: "open-pdf",
},
],
setup(host) {
host.onOpen("open-pdf", (item) => {
host.tabs.openTab(item.path);
});
},
});Resolution order
User double-clicks an item
→ ModuleRegistry.resolveOpen(item)
→ each handler's match(item) is evaluated, highest priority wins
→ the function registered via host.onOpen(...) runs
→ default: core.navigation (priority 0) → folder→navigate, file→openItemBecause the core navigation defaults register at priority 0, any community module can override them by declaring a higher priority.
Permissions & Capabilities
The complete capability vocabulary and the permission each one requires — the one file that defines everything a module can do.
Virtual File Systems
Serve a URI scheme (WebDAV, S3, an archive) as a browsable, editable file system — without the rest of the app knowing it isn't local disk.