Skip to content

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 frame
await kaba.views.createPane(0, 'kaba://terminal/');
// Open a URL in a new frame, next to the current one
await kaba.views.createTab('https://example.com', {
setActive: true,
adjacentActive: true,
});
// Reload the current page, bypassing the cache
await kaba.views.hardReload();

[todo: confirm argument lists and return shapes for the methods below against the source before publishing as a stable reference.]

MethodPurpose
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.
MethodPurpose
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.

frameGroups(), frameGroupCreate(), frameGroupUpdate(), frameGroupAssign(), frameGroupMove(), frameGroupRemove(), openFrameGroup(), openUrlsAsGroup(), showFrameGroupContextMenu().

MethodPurpose
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.
MethodPurpose
currentPaneLayout(), loadPaneLayout()Read a frame’s layout and restore one.
getLayoutMode(), setLayoutMode()Tiling or tabbed.
setFloatBounds(), raiseFloat()Floating panes.
toggleShellInterface(), toggleSidebarHidden()Minimal mode.
MethodPurpose
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.
MethodPurpose
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.

takeCapture(), capturePane(), captureScreenshotViewport(), captureAllKabaFrames().

These run script in a page or perform a trusted click. They are what the tool loop’s web tools are built on.

MethodPurpose
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.

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 lets one pane attach to another and work on it, the way the source editor attaches to the page it is editing.

MethodPurpose
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
});