[Launch options](https://cdpfleet.com/docs/options)

# `main_world_eval`

Allow scripts in the page's main world.

**Use it for:** Reading values exactly as the page's own scripts see them, and calling functions the page defines, from `page.evaluate`.

**Browsers:** [Camoufox](https://cdpfleet.com/docs/browsers/camoufox#opt-main_world_eval).

## Details

-   **Type:** `boolean`
-   **Default:** false
-   **Example:** `{"main_world_eval":true}`

Enables `page.evaluate("mw:" + script)` to run in the page's own JavaScript world instead of an isolated one.

Main-world scripts are visible to the page.

## Used in

-   [Case 74: Does the browser agree with its IP? Timezone, language and WebRTC through exits in three countries](https://cdpfleet.com/docs/cases/timezone-locale-ip-consistency)
-   [Case 16: What headless gives away, what headful fixes, and what neither does](https://cdpfleet.com/docs/cases/headless-tells)
-   [Case 15: Three countries, one script — and reading values the way the site does](https://cdpfleet.com/docs/cases/three-countries)
-   [Camoufox: pinned version, macOS persona, no images](https://cdpfleet.com/docs/examples#camoufox-lean-persona)

All options: [launch options](https://cdpfleet.com/docs/options).

---
Source: https://cdpfleet.com/docs/options/main_world_eval · Markdown: https://cdpfleet.com/docs/options/main_world_eval.md · All docs for AI tools: https://cdpfleet.com/llms.txt
