You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried using the method from this example, it didn’t work. The new header attribute does not appear in the Chrome network panel.
browser:=rod.New().ControlURL(launcher.New().Headless(false).Bin("/Applications/Google Chrome.app/Contents/MacOS/Google Chrom").MustConnect()
deferbrowser.MustClose()
router:=browser.HijackRequests()
deferrouter.MustStop()
router.MustAdd("*.js", func(ctx*rod.Hijack) {
// Here we update the request's header. Rod gives functionality to// change or update all parts of the request. Refer to the documentation// for more information.ctx.Request.Req().Header.Set("My-Header", "test")
// LoadResponse runs the default request to the destination of the request.// Not calling this will require you to mock the entire response.// This can be done with the SetXxx (Status, Header, Body) functions on the// ctx.Response struct._=ctx.LoadResponse(http.DefaultClient, true)
// Here we append some code to every js file.// The code will update the document title to "hi"ctx.Response.SetBody(ctx.Response.Body() +"\n document.title = 'hi' ")
})
gorouter.Run()
browser.MustPage("https://go-rod.github.io").MustWait(`() => document.title === 'hi'`)
The text was updated successfully, but these errors were encountered:
Rod Version: v0.116.2
When I tried using the method from this example, it didn’t work. The new header attribute does not appear in the Chrome network panel.
The text was updated successfully, but these errors were encountered: