kaba.views
kaba.views controls frames and panes. It is the part of the SDK that the shell, the desktop and the tool loop use to open things and move them around. It is available only on kaba:// pages.
In method names, a tab is a frame and a pane is a pane.
// Open a terminal in a new pane of the current frameawait kaba.views.createPane(0, 'kaba://terminal/');
// Open a URL in a new frame, next to the current oneawait kaba.views.createTab('https://example.com', { setActive: true, adjacentActive: true,});
// Reload the current page, bypassing the cacheawait kaba.views.hardReload();[todo: confirm argument lists and return shapes for the methods below against the source before publishing as a stable reference.]
| Method | Purpose |
|---|---|
getState(), refreshState(), getTabState() | Frames, panes and what each shows. |
getNetworkState() | Connection state. |
getCallerTabId(), getFrameId(), getPaneId() | Where the calling page lives. |
getWindowId() | Synchronous. |
paneInfo() | Synchronous. |
panesUsage() | Memory and CPU per pane. |
createEventStream() | Frame and pane events. Returns an event target. |
Frames
Section titled “Frames”| Method | Purpose |
|---|---|
createTab(), closeTab(), closeCallerTab(), minimizeTab() | Open and close frames. |
setActiveTab(), nextFrame(), prevFrame() | Switch. |
reorderTab(), applyTabOrder() | Reorder. |
toggleFrames() | Show the frames view. |
organizeFrame() | Rebalance the current frame. |
showFrameContextMenu(), showTabContextMenu(), showHeaderContextMenu(), showLocationBarContextMenu() | Native menus. |
Frame groups
Section titled “Frame groups”frameGroups(), frameGroupCreate(), frameGroupUpdate(), frameGroupAssign(), frameGroupMove(), frameGroupRemove(), openFrameGroup(), openUrlsAsGroup(), showFrameGroupContextMenu().
| Method | Purpose |
|---|---|
createPane(), closePane(), removePane() | Open and close. |
createGhostPane(), setPaneGhostMode(), setPaneTorMode() | Ghost Mode and Tor for a pane. |
setActivePane() | Focus. |
swapPanesById(), movePaneTo(), previewPaneMove() | Move. |
setPaneResizeModeEnabled() | Resize mode. |
enablePaneFullscreen(), disablePaneFullscreen(), isPaneFullscreen(), hasPaneFullscreen(), toggleFullscreen() | Pane fullscreen. |
togglePaneByOrigin() | Show or hide the pane for an origin. |
reloadPane(), stopPane(), goBackByPaneId(), goForwardByPaneId(), toggleDevToolsByPaneId() | Act on a pane by ID. |
openPaneMenu(), openAttachMenu() | Pane menus. |
setPaneDriven() | Mark a pane as being driven by Kaba. Synchronous. |
setPaneViewsHidden() | Hide pane contents temporarily. |
Layout
Section titled “Layout”| Method | Purpose |
|---|---|
currentPaneLayout(), loadPaneLayout() | Read a frame’s layout and restore one. |
getLayoutMode(), setLayoutMode() | Tiling or tabbed. |
setFloatBounds(), raiseFloat() | Floating panes. |
toggleShellInterface(), toggleSidebarHidden() | Minimal mode. |
Navigation
Section titled “Navigation”| Method | Purpose |
|---|---|
loadURL(), loadURLChecked() | Navigate the active pane. |
goBack(), goForward(), stop(), reload(), hardReload() | History and reload. |
clearSiteDataAndReload() | Clear the site’s data, then reload. |
resetZoom() | Actual size. |
print() | Print the page. |
toggleDevTools() | Developer tools. |
toggleLiveReloading() | Reload on file change. |
Shell surfaces
Section titled “Shell surfaces”| Method | Purpose |
|---|---|
toggleOmnibar(), showLocationBar(), hideLocationBar(), runLocationBarCmd() | The omnibar. |
showInpageFind(), hideInpageFind(), setInpageFindString(), moveInpageFind() | Find in page. |
showMenu(), toggleMenu(), updateMenu() | Shell menus. |
toggleSiteInfo() | The Kaba bar’s site panel. |
toggleMediaView() | Media controls. |
createToast() | Show a toast. |
focusShellWindow(), focusPage() | Focus. |
dismissReloadHint(), reloadHintAction() | The reload-to-apply hint. |
Capture
Section titled “Capture”takeCapture(), capturePane(), captureScreenshotViewport(), captureAllKabaFrames().
Driving pages
Section titled “Driving pages”These run script in a page or perform a trusted click. They are what the tool loop’s web tools are built on.
| Method | Purpose |
|---|---|
runInActiveFrame(), runInAllFrames() | In the active pane. |
runInPane(), runInPaneAllFrames() | In a pane by ID. |
trustedClickActive(), trustedClickPane() | A real click at a point. |
bgOpen(), bgRun(), bgRunAllFrames(), bgTrustedClick(), bgCurrentUrl(), bgClose() | A background page that is not shown. |
getBackgroundTabs(), restoreBgTab(), closeBgTab() | Manage background pages. |
Memory helpers
Section titled “Memory helpers”createEmbedding(), updateEmbedding(), deleteEmbedding(), findEmbedding(), getEmbeddingByUrl(), getAllEmbeddings(), searchEmbeddings() create and query the memory for a page. ask() sends a prompt. reloadAI() restarts the model worker.
kaba.panes
Section titled “kaba.panes”kaba.panes lets one pane attach to another and work on it, the way the source editor attaches to the page it is editing.
| Method | Purpose |
|---|---|
setAttachable() | Allow this pane to be attached to. Synchronous. |
attachToLastActivePane(), attachById(), detach() | Attach and detach. |
getAttachedPane() | Synchronous. Prefer getAttachedPaneAsync(). |
create(), navigate(), navigateChecked(), focus(), close() | Act on the attached pane. |
executeJavaScript(), executeJavaScriptAllFrames(), trustedClick() | Run script or click in it. |
injectCss(), uninjectCss() | Style it. |
kaba.panes is also an event target, with pane-attached, pane-detached and pane-navigated events:
kaba.panes.addEventListener('pane-navigated', (e) => { // the attached pane went somewhere new});