code-yeongyu/oh-my-openagent / packages/shared-skills/skills/ultimate-browsing
ultimate-browsing
FlaggedReaches web pages the user's browser cannot open: WAF-blocked and bot-scored hosts, platform-native readers (Chinese and social platforms), archive snapshots with provenance, and a browser you own for stealth or throwaway profiles. Not for plain search, an unblocked static fetch, or a page the user's browser can open.
engine/templates/playwright_mobile_chrome.js
View on GitHub#!/usr/bin/env node
/**
* Generic Playwright mobile fetcher — real Chrome + device emulation.
*
* Usage:
* echo '{"url":"...", "device":"iPhone 13 Pro"}' | node playwright_mobile_chrome.js
*
* Device name must match playwright `devices[...]` keys (Pixel 7, iPhone 13 Pro,
* iPad Pro 11, etc.). When in doubt, omit `device` — default is iPhone 13 Pro.
*
* NO-SITE-NAME RULE: same as playwright_real_chrome.js — no hostname branches.
*/
async function readStdinJson() {
return await new Promise((resolve, reject) => {
let data = ""
process.stdin.on("data", (c) => (data += c))
process.stdin.on("end", () => {
try {
resolve(JSON.parse(data || "{}"))
} catch (e) {
reject(e)
}
})
process.stdin.on("error", reject)
})
}
function describeError(error) {
if (error instanceof Error) {
return `${error.name}: ${error.message}`
}
return String(error)
}
function warnBestEffort(action, error) {
process.stderr.write(`best-effort ${action} failed: ${describeError(error)}\n`)
}
function isMissingTopLevelModule(error, moduleName) {
return (
error instanceof Error &&
error.code === "MODULE_NOT_FOUND" &&
typeof error.message === "string" &&
error.message.includes(`Cannot find module '${moduleName}'`)
)
}
function requireOptionalModule(moduleName) {
let resolvedModule
try {
resolvedModule = require.resolve(moduleName)
} catch (e) {
if (isMissingTopLevelModule(e, moduleName)) {
warnBestEffort(`optional module ${moduleName}`, e)
return null
}
throw e
}
return require(resolvedModule)
}
async function main() {
const args = await readStdinJson()
const url = args.url
if (!url) {
process.stderr.write("missing url\n")
process.exitCode = 2
return
}
const profileDir = args.profileDir || "/tmp/.insane_pw_mobile_profile"
const deviceName = args.device || "iPhone 13 Pro"
const waitSelector = args.waitSelector || null
const timeoutMs = args.timeout || 60000
const headless = args.headless ?? false
let chromium, devices
const playwrightExtra = requireOptionalModule("playwright-extra")
const stealthPlugin = playwrightExtra ? requireOptionalModule("puppeteer-extra-plugin-stealth") : null
if (playwrightExtra && stealthPlugin) {
;({ devices } = require("playwright-core"))
chromium = playwrightExtra.addExtra(require("playwright-core").chromium)
const stealth = stealthPlugin()
chromium.use(stealth)
} else {
;({ chromium, devices } = require("playwright-core"))
}
const dev = devices[deviceName]
if (!dev) {
process.stderr.write(`unknown device: ${deviceName}\n`)
process.exitCode = 2
return
}
let ctx
try {
ctx = await chromium.launchPersistentContext(profileDir, {
channel: "chrome",
args: ["--disable-blink-features=AutomationControlled"],
ignoreDefaultArgs: ["--enable-automation"],
headless,
...dev,
})
const page = await ctx.newPage()
const navTimeout = Math.min(timeoutMs, 90000)
await page.goto(url, { waitUntil: "domcontentloaded", timeout: navTimeout })
if (waitSelector) {
try {
await page.waitForSelector(waitSelector, { timeout: Math.min(timeoutMs, 20000) })
} catch (e) {
warnBestEffort("waitSelector", e)
}
}
const html = await page.content()
process.stdout.write(html)
process.exitCode = 0
return
} catch (e) {
process.stderr.write(`${describeError(e)}\n`)
process.exitCode = 1
return
} finally {
try {
if (ctx) await ctx.close()
} catch (e) {
warnBestEffort("browser context close", e)
}
}
}
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |