-
-
Notifications
You must be signed in to change notification settings - Fork 214
Description
Environment Information
- Playwright Go version: github.com/playwright-community/playwright-go (latest)
- Chromium version: chromium-1169
- Operating System: macOS (based on path structure in issue)
- Go Version: go1.24.4
Issue Description
When using page.OnDOMContentLoaded callback in Playwright Go with chromium-1169, executing any JavaScript code within the callback causes the process to block indefinitely. The callback is triggered but the execution hangs and never completes.
Reproduction Code
page.OnDOMContentLoaded(func(p playwright.Page) {
logger.Info("loaded")
rsp, err := p.EvaluateHandle("(()=>{console.log('hook code loaded');return 1;})();")
fmt.Println(rsp, err)
})Expected Behavior
The JavaScript code should execute successfully within the OnDOMContentLoaded callback, return the result, and continue normal program execution.
Actual Behavior
The process blocks indefinitely when executing any JavaScript code (including simple console.log or EvaluateHandle calls) within the OnDOMContentLoaded callback.
Additional Context
This issue occurs with chromium-1169 version where JavaScript execution within the OnDOMContentLoaded event callback does not complete properly. The callback itself is properly triggered as evidenced by the "loaded" log message, but subsequent JavaScript execution within that context results in blocking behavior.
Workaround
Currently, there is no known workaround other than avoiding JavaScript execution within the OnDOMContentLoaded callback.