code-yeongyu/oh-my-openagent / packages/shared-skills/skills/browser
browser
VerifiedDrives a real browser through the omowright library from the js eval kernel: sites the user is already signed into, forms and clicks, JS-rendered pages, screenshots, web QA, extension popups, a human handoff for login, CAPTCHA or OTP, and a browser you own for scraping, bot-scored targets, network capture and QA traces. Use for any interactive browser task; not for a plain search or an unblocked static fetch.
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 303 B |
| .npmignore | other | 160 B |
| ATTRIBUTION.md | markdown | 2.1 KB |
| SKILL.md | skill md | 10.3 KB |
| references/commands.md | markdown | 8.6 KB |
| references/install.md | markdown | 5.7 KB |
| references/owned-engine/README.md | markdown | 3.2 KB |
| references/owned-engine/frames-and-humans.md | markdown | 3.1 KB |
| references/owned-engine/ladder.md | markdown | 3.8 KB |
| references/owned-engine/network.md | markdown | 2.9 KB |
| references/recipes/1password.md | markdown | 2.8 KB |
| references/remote.md | markdown | 1.1 KB |
| scripts/browser-doctor-report.mjs | script | 5.5 KB |
| scripts/browser-doctor.mjsexecutable | script | 1.9 KB |
| scripts/browser-engine-guard.mjs | script | 3.5 KB |
| scripts/browser-install.mjsexecutable | script | 3.0 KB |
| scripts/omowright.mjs | script | 2.1 KB |
scripts/browser-engine-guard.mjs
View on GitHubimport { readFile } from "node:fs/promises"
export const BROWSER_ENGINE_ENV = "OMO_BROWSER_ENGINE"
const TOOLKIT_TOOL = "omo_desktop_toolkit"
const BUILTIN_UNAVAILABLE = {
unavailable: "this app does not offer its built-in browser to this session",
timeout: "the app did not answer the request for its built-in browser",
invalid_grant: "the app answered the request for its built-in browser with something unusable",
}
export class BuiltinBrowserUnavailableError extends Error {
constructor(reason) {
const unavailable = Object.hasOwn(BUILTIN_UNAVAILABLE, reason)
super(
unavailable
? `OmO's built-in browser is not available here: ${BUILTIN_UNAVAILABLE[reason]}. Every other browser works as usual: connectBrowserSkill() for the user's own browser, connectPipe() for a browser of your own.`
: `OmO's built-in browser was refused: ${reason === "user_stopped" ? "the user stopped browser work" : `the app refused it (${reason})`}. Stop browser work and report the refusal; do not open another browser.`,
)
this.name = "BuiltinBrowserUnavailableError"
this.code = "browser_builtin_unavailable"
this.reason = reason
}
}
/**
* Inside OmO Desktop (`OMO_BROWSER_ENGINE` set) the library is the terminal's own, unchanged, plus
* `connectBuiltinBrowser()`: the app's built-in browser for this thread, the tab the user sees beside the chat.
*/
export function guardOmowright(raw, { env = process.env, host } = {}) {
const engine = env[BROWSER_ENGINE_ENV]
if (engine === undefined || engine === "") return raw
const acquireBuiltinBrowser = async () => {
let details
try {
details = (await host?.callTool(TOOLKIT_TOOL, { op: "acquire", toolkit: "browser" }))?.details
} catch {
details = undefined
}
if (details?.ok !== true)
throw new BuiltinBrowserUnavailableError(typeof details?.reason === "string" ? details.reason : "unavailable")
// Without an endpoint CdpClient falls back to 127.0.0.1:9222 and would send the token to whatever listens there.
const endpoint = details.grant?.endpoint
if (typeof endpoint !== "string" || endpoint === "") throw new BuiltinBrowserUnavailableError("invalid_grant")
let token
try {
token = (await readFile(details.grant.tokenFile, "utf8")).trim()
} catch {
throw new BuiltinBrowserUnavailableError("invalid_grant")
}
return { endpoint, authorization: `Bearer ${token}` }
}
// A CDP endpoint that shows only this thread's tabs. The token is read from the file the grant names, so it never
// passes through a tool result.
const connectBuiltinBrowser = async (options = {}) => {
let current = await acquireBuiltinBrowser()
// Concurrent refreshes share one acquire, so a token is never paired with another grant's endpoint.
let refreshing
const authorizer = {
async resolveAuthorization({ forceRefresh } = {}) {
if (forceRefresh) {
refreshing ??= acquireBuiltinBrowser()
.then((next) => {
current = next
client.cdpUrl = next.endpoint
return next
})
.finally(() => {
refreshing = undefined
})
return (await refreshing).authorization
}
return current.authorization
},
}
const client = new raw.CdpClient({ ...options.client, cdpUrl: current.endpoint, authorizer })
return await new raw.BrowserConnection(client, options).initialize()
}
return { ...raw, connectBuiltinBrowser }
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |