You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
Webterm is designed to run in "companion mode" with a browsing context. (That is, as a sidebar in an active browser window.) When in companion mode, webterm has an "active page."
"Page commands" would provide a way for the active page to export commands which are callable by webterm. This would be via some API such as:
navigator.registerCommand({
name: 'hello',
help: 'Say hello on the page',
usage: 'hello [-u/--uppercase]',
options: [
{
name: 'uppercase',
abbr: 'u',
help: 'Output hello in all caps',
boolean: true,
default: false
}
],
async command (opts) {
var div = document.createElement('div')
div.textContent = (opts.uppercase) ? 'HELLO' : 'hello'
document.body.append(div)
}
})
Page commands automatically have an @ prefix, which helps avoid collisions with the environment's installed commands. The above command would be invoked like this:
@hello -u
Page commands would be executed in the active page's context. The invocation and response would be serialized as a message and sent between the webterm context and the page context.
The text was updated successfully, but these errors were encountered:
Webterm is designed to run in "companion mode" with a browsing context. (That is, as a sidebar in an active browser window.) When in companion mode, webterm has an "active page."
"Page commands" would provide a way for the active page to export commands which are callable by webterm. This would be via some API such as:
Page commands automatically have an
@
prefix, which helps avoid collisions with the environment's installed commands. The above command would be invoked like this:Page commands would be executed in the active page's context. The invocation and response would be serialized as a message and sent between the webterm context and the page context.
The text was updated successfully, but these errors were encountered: