playwright-go icon indicating copy to clipboard operation
playwright-go copied to clipboard

[Bug]: route.Continue() with RouteContinueOptions{} provided will hang.

Open allendolgonos opened this issue 10 months ago • 2 comments

Environments

  • playwright-go Version: Latest
  • Browser: Chromium
  • OS and version: Windows 11

Bug description

To Reproduce Example:

package main

import "github.com/playwright-community/playwright-go"

func main() {
	// ignore unnecessary error handling code
	pw, _ := playwright.Run()
	browser, _ := pw.Chromium.Launch()
	context, _ := browser.NewContext()
	page, _ := context.NewPage()

        err = task.page.Route("**/*", func(route playwright.Route) {
		request := route.Request()
		headers := request.Headers()
		err = route.Continue(playwright.RouteContinueOptions{Headers: headers}) // Should not hang
		if err != nil {
			log.Println("Error occurred while continuing route")
			return
		}
	})
	if err != nil {
		return err
	}

	_, _ = page.Goto("https://playwright.dev")
}

Additional context Router hangs when doing route.Continute with ANY RouteContinueOptions. When I remove the RouteContinueOptions, the route.Continue() function works as intended. When even just providing the original headers of the request, route.Continue(...) hangs.

allendolgonos avatar Jan 24 '25 18:01 allendolgonos

https://github.com/playwright-community/playwright-go/issues/519

nexcode avatar Jan 28 '25 09:01 nexcode

The issue is that the headers call is blocking, not necessarily that the RouteContinueOptions are causing the hang

  • https://github.com/playwright-community/playwright-go/issues/398

derekperkins avatar May 06 '25 20:05 derekperkins