Browser Extensions
Load custom Chrome extensions into your cloud browser sessions. Upload extension packages and reference them by ID when creating sessions.
Uploading an Extension
import { ScrayleClient } from '@scrayle/sdk';
const client = new ScrayleClient();
const ext = await client.browser.extension.upload(
'./my-extension.zip', // Path to ZIP file
'My Cool Extension' // Display name
);
console.log(ext.extensionId); // Use this ID in browser sessionsUsing Extensions in a Session
import { Playwright } from '@scrayle/sdk';
const { browserWSEndpoint } = await Playwright.connect({
extensionIds: 'ext_abc123', // Single extension
// extensionIds: 'ext_abc,ext_def', // Multiple (comma-separated)
});Managing Extensions
List Extensions
const extensions = await client.browser.extension.list();
for (const ext of extensions) {
console.log(ext.extensionId, ext.name, ext.version);
}Get Extension Details
const ext = await client.browser.extension.get('ext_abc123');
console.log(ext.name, ext.version, ext.manifestName);Update an Extension
await client.browser.extension.update(
'ext_abc123',
'./my-extension-v2.zip',
'My Cool Extension v2' // Optional new name
);Delete an Extension
await client.browser.extension.delete('ext_abc123');Extension Format
Extensions must be uploaded as .zip files containing a valid Chrome extension with a manifest.json at the root level.
API Reference
| Method | Description |
|---|---|
browser.extension.upload(filePath, name) | Upload a new extension |
browser.extension.update(id, filePath, name?) | Update an existing extension |
browser.extension.get(id) | Get extension details |
browser.extension.list() | List all extensions |
browser.extension.delete(id) | Delete an extension |