Open a dialog that displays essential information about the application
Call close function for Usersnap forms known to the application
Experimentalplatform.createCreate a new application window
This command is unstable and may change or disappear without notice
Experimentalplatform.getGet the ID of the currently focused window, or undefined if no window is focused
This command is unstable and may change or disappear without notice
Get the current log file content for debugging purposes
Get the operating system platform
Experimentalplatform.getList every open window with the title it is currently showing, for offering the user a choice of window. Titles follow each window's own content, so two windows showing the same thing carry the same label and nothing distinguishes them.
This command is unstable and may change or disappear without notice
Experimentalplatform.goNavigate the active scroll group to the next book (chapter 1, verse 1)
This command is unstable and may change or disappear without notice
Experimentalplatform.goNavigate the active scroll group to the next chapter (rolls into the next book)
This command is unstable and may change or disappear without notice
Experimentalplatform.goNavigate the active scroll group to the next verse
This command is unstable and may change or disappear without notice
Experimentalplatform.goNavigate the active scroll group to the previous book (chapter 1, verse 1)
This command is unstable and may change or disappear without notice
Experimentalplatform.goNavigate the active scroll group to the previous chapter (rolls into the previous book)
This command is unstable and may change or disappear without notice
Experimentalplatform.goNavigate the active scroll group to the previous verse
This command is unstable and may change or disappear without notice
If the browser window is in full screen
Check if a Usersnap form is currently open
Experimentalplatform.moveMove a web view to a window created for it.
A move closes the web view in the window that holds it and reopens it — same
useWebViewState state — in the target window. Consumers see a close event in the source and
an open event in the target, and the web view controller is disposed and re-created: a held
controller reference must be re-acquired after a move. The returned id is the authoritative
id of the web view after the move — the same id as webViewId, since a web view keeps the id
it was minted with for its whole life, across any number of moves — so use the returned id
for anything after the move. In Simple mode — single-window by design — there is no other
window to move to, and this does nothing.
A failed move says where it left the web view, as a machine-readable marker at the front of
the error message: [webViewMoveFailure:<where>], where <where> is
reopened-in-source-window (nothing about where it lives changed),
reopened-in-focused-window (it did move, just not to the window that was asked for),
not-reopened (it is open in no window, and only the log holds what it was),
reached-new-window-unconfirmed (the window created for the move is holding it, but the move
could not get that confirmed), possibly-closed (taking it out of its window is what failed,
so where it is cannot be told), or already-moving (this call was refused before it started,
because another move of the same web view was already running — the web view is wherever that
other move leaves it). The marker rides in the message because a rejection that crosses
processes reaches its caller as a code and a message and nothing else. A failure decided
before the move touches the web view for any other reason — an unknown target window, a
target on its way out, an interface mode that could not be read — carries no marker. Strip
the marker before showing the message to a user — it is there to be classified on, not read.
Web view to move
OptionalisUserRequested: booleanWhether a person in this app asked for this move — a tab's own context
menu did. Defaults to false, which is the right answer for an extension moving a view on
its own: the window that appears does not take the foreground, so it cannot interrupt
whatever the user is doing. Pass true only from a control the user operated
Authoritative id of the web view in its new window — the same id as webViewId; see
above
The isUserRequested parameter is new; the rest of this command is
long-established.
Experimentalplatform.moveMove a web view to an existing window, named by its window id (see
papi.window.getWindowId() for the id of the window the caller is in, or
platform.getFocusedWindowId for whichever window the user is looking at). Ids are
platform-assigned and never reused within a profile.
Same semantics as platform.moveWebViewToNewWindow — including the marker a failed move
carries to say where it left the web view — and: moving a web view to the window it is
already in does nothing, and naming a window that does not exist is an error that leaves the
web view where it is.
Web view to move
Window to move it to
OptionalisUserRequested: booleanWhether a person in this app asked for this move — a tab's own context
menu did. Defaults to false, which is the right answer for an extension moving a view on
its own. A target window the platform opened without activation and the user has not yet
been in stays backgrounded unless this is true: naming it is the user asking to go there,
which is what raises it. Pass true only from a control the user operated
Authoritative id of the web view in its new window — the same id as webViewId; see
platform.moveWebViewToNewWindow
The isUserRequested parameter is new; the rest of this command is
long-established.
Experimentalplatform.navigateNavigate the reference history in the physical "left" direction. Acts on the same scroll group the top toolbar follows (the active web view's scroll group), so a keyboard shortcut and the on-screen history buttons can never disagree. The window supplies its UI layout direction and the physical direction is resolved to a logical one against it: left = back in LTR, forward in RTL (the pair swaps, physical-direction preserving). The main-process keyboard handler dispatches this directly so it never needs to know the UI direction or the active scroll group.
true if navigation happened; false when there is no history in that direction or
the active web view has no scroll group (a detached ref)
Experimentalplatform.navigateNavigate the reference history in the physical "right" direction. Acts on the same scroll group the top toolbar follows (the active web view's scroll group), so a keyboard shortcut and the on-screen history buttons can never disagree. The window supplies its UI layout direction and the physical direction is resolved to a logical one against it: right = forward in LTR, back in RTL (the pair swaps, physical-direction preserving). The main-process keyboard handler dispatches this directly so it never needs to know the UI direction or the active scroll group.
true if navigation happened; false when there is no history in that direction or
the active web view has no scroll group (a detached ref)
Experimentalplatform.openOpen the appropriate Book Chapter Control (the active tab's if it shows one, else the top toolbar's) and focus its input, ready for typing a reference
This command is unstable and may change or disappear without notice
Open a browser to the platform's OpenRPC documentation
Open the Terms of Service document that ships beside the application - the terms the distributed application is licensed to the user under, rather than this repository's AGPL source (see LICENSING.md).
The document is a self-contained HTML file, shown in a window the application owns rather than handed to the operating system. One window at a time: a second request focuses the one already open. Every link in the document leaves through the browser, so the window only ever shows the document.
Open a link in a new browser window. Like window.open in the frontend with
target='_blank' Consider using a visual indication along with this. E.g. for a menu
download the https://lucide.dev/icons/external-link icon, add it to your extension's assets
folder and use it like
"iconPathAfter": "papi-extension://<yourExtension>/assets/icons/external-link.svg". We plan
to provide a common set of icons via an API in the future.For a button that opens external urls add
aria-label="{localizedStrings['%ariaLabel_opensInBrowser%']}"<ExternalLink />Shut down the application
Restart the application
Experimentalplatform.showShow the orientation tour again from its first stop, in the window the user is working in. Available in both interface modes: in Power mode the tour reduces to the stops whose anchors exist there, which today is the toolbar's profile button.
This command is unstable and may change or disappear without notice
Open Usersnap feedback form to report an issue
Open Usersnap feedback form to submit an idea
Increase the zoom level of the entire UI
Decrease the zoom level of the entire UI
Function types for each command available on the papi. Each extension can extend this interface to add commands that it registers on the papi with
papi.commands.registerCommand.Note: Command names must consist of two strings separated by at least one period. We recommend one period and lower camel case in case we expand the api in the future to allow dot notation.
An extension can extend this interface to add types for the commands it registers by adding the following to its
.d.tsfile:Example