browser_reload

Browser Reload

Reload the current page. Optionally bypass the browser cache for a hard reload that fetches all resources fresh from the server. Useful when testing changes or clearing stale cached content.

Usage Example

CURL

curl -X POST \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: application/json" \
 -d '{
"context_id": "ctx_000001"
}' \
http://localhost:8080/api/execute/browser_reload

Python SDK

import asyncio
from owl_browser import OwlBrowser, RemoteConfig

# Async usage
async with OwlBrowser(config) as browser:
    context = await browser.create_context()
    context_id = context["context_id"]
    await browser.reload(
        context_id=context_id
    )

Node.js SDK

import { OwlBrowser } from '@olib-ai/owl-browser-sdk';

// Async usage
const ctx = await browser.createContext();
const contextId = ctx.context_id;
await browser.reload({
    context_id: contextId
});

Parameters

Required

  • context_id string - The unique identifier of the browser context (e.g., 'ctx_000001')

Optional

  • ignore_cache boolean - When true, performs a hard reload that bypasses the browser cache and fetches all resources from the server. Equivalent to Ctrl+Shift+R. Default: false (normal reload using cache)
  • wait_until enum - load, domcontentloaded, networkidle, fullscroll... When to consider reload complete: '' (return immediately), 'load' (wait for load event, default), 'domcontentloaded' (wait for DOMContentLoaded), 'networkidle' (wait for network to be idle), 'fullscroll' (scroll full page to trigger lazy loading, then scroll back to top)
  • timeout string - Maximum time to wait for reload in milliseconds. Only used when wait_until is set. Default: 30000 (30 seconds)

Response

Returns a JSON object with the operation result.

{
    "success": true,
    "result": <value>
}