modify template
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
# Browser Capability: viewport
|
||||
Browser viewport override control. Do not set the viewport during normal browser setup; most tasks should use the existing/default 1280x720 viewport. Use `set()` only when the user asks for specific dimensions, asks to test a responsive breakpoint or device size, or the task cannot be answered correctly without a specific viewport. Do not resize the browser just to make a screenshot larger, prettier, or fit more content. Use the default viewport, a normal screenshot, or a full-page screenshot instead. If you set a temporary viewport, call `reset()` before finishing unless the user asked to keep that viewport.
|
||||
|
||||
```ts
|
||||
const capability = await browser.capabilities.get("viewport");
|
||||
|
||||
interface ViewportSize {
|
||||
height: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
interface ViewportBrowserCapability {
|
||||
reset(): Promise<void>; // Clear the explicit viewport override and return to default browser sizing.
|
||||
set(options: ViewportSize): Promise<void>; // Apply an explicit browser viewport override.
|
||||
}
|
||||
```
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# Browser Capability: visibility
|
||||
Browser visibility control. Use `set(true)` to present the browser visually to the user, `set(false)` to hide it, and `get()` to check whether it is currently visible. Keep browser work in the background unless the user asks to see it or live viewing is useful. When the browser should be visible, call `set(true)`. When taking screenshots to verify browser behavior, include them in progress updates when possible and include the relevant screenshots inline in the final response with Markdown image syntax unless the user asks for text only.
|
||||
|
||||
```ts
|
||||
const capability = await browser.capabilities.get("visibility");
|
||||
|
||||
interface VisibilityBrowserCapability {
|
||||
get(): Promise<boolean>; // Read whether the browser is visually presented to the user.
|
||||
set(visible: boolean): Promise<void>; // Set whether the browser is visually presented to the user.
|
||||
}
|
||||
```
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# Tab Capability: pageAssets
|
||||
Asset inventory and bundling for the current rendered page state. Use `list()` to inspect assets already observed in the tab's current state. If lazy-loaded content or another UI state matters, load that state first, then call `list()` again so the inventory reflects what is currently observable. Use `bundle()` to export discovered file assets into a temporary local artifact directory. Prefer `kinds` for broad acquisition and `assetIds` for narrow follow-up. Do not navigate directly to asset URLs just to fetch them.
|
||||
|
||||
```ts
|
||||
const capability = await tab.capabilities.get("pageAssets");
|
||||
|
||||
interface PageAssetsTabCapability {
|
||||
bundle(options: { assetIds?: Array<string>; inventoryId: string; kinds?: Array<"font" | "image" | "stylesheet" | "video"> }): Promise<{ assets: Array<{ contentType: null | string; id: string; kind: "font" | "image" | "stylesheet" | "video"; name: string; path: string; url: string }>; directoryPath: string; failures: Array<{ contentType: null | string; id: string; name: string; reason: string; url: string }>; manifestPath: string; summary: { downloadedCount: number; elapsedMs: number; failedCount: number; requestedCount: number } }>; // Export file assets from a prior inventory into a local artifact directory.
|
||||
list(): Promise<{ assets: Array<{ id: string; kind: "script" | "font" | "image" | "stylesheet" | "video" | "other"; name: string; sources: Array<{ kind: "attribute" | "computedStyle" | "resource"; nodeId?: number; property?: string }>; url: string }>; id: string; inlineSvgs: Array<{ id: string; markup: string; name: string }>; pageUrl: null | string; summary: { byKind: Partial<Record<"script" | "font" | "image" | "stylesheet" | "video" | "other", number>>; inlineSvgCount: number; totalCount: number } }>; // Inventory file assets and inline SVGs observed in the current page state.
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user