Skip to content

Bug: MustWaitStable causes panic after browser.MustPage() #1157

Open
@independentid

Description

@independentid

After calling browser.MustPage(url), a subsequent call to MustWaitStable causes panic. While Must normally throws a panic if an error occurs, it seems unexpected that MustWaitStable would throw any errors since it isn't triggering on any type of content. The bug is really about getting Execution context was destroyed except when stepping in the debug mode.

    l := launcher.New().
        Headless(false).
        Devtools(true).
        Set("disable-gpu", "true")
    defer l.Cleanup()

    // Launch the browser and return the URL for the browser control service
    bUrl := l.MustLaunch()

    browser := rod.New().ControlURL(bUrl).
        Trace(true).
        SlowMotion(time.Second).
        MustConnect()

    browser.IgnoreCertErrors(true)
    defer browser.MustClose()

    page := browser.MustPage(oagUrl)
    page.MustWaitStable()

Panic report:

[rod] 2024/11/30 16:37:09 [wait] stable <page:BBC7C4AF>
[rod] 2024/11/30 16:37:09 [wait] dom-stable <page:BBC7C4AF>
[rod] 2024/11/30 16:37:09 [wait] request-idle <page:BBC7C4AF>
[rod] 2024/11/30 16:37:09 [wait] load <page:BBC7C4AF>
[rod] 2024/11/30 16:37:09 [wait requests idle] map[excludes:[] includes:[]] <page:BBC7C4AF>
[rod] 2024/11/30 16:37:10 [wait requests] <page:BBC7C4AF> map[]
panic: {-32000 Execution context was destroyed. }
 
goroutine 1 [running]:
github.com/go-rod/rod/lib/utils.init.func2({0x1016f7860, 0x14000299f20})
        /Users/pjdhunt/go/pkg/mod/github.com/go-rod/[email protected]/lib/utils/utils.go:68 +0x24
github.com/go-rod/rod.genE.func1({0x140002a7830, 0x1, 0x1})
        /Users/pjdhunt/go/pkg/mod/github.com/go-rod/[email protected]/must.go:36 +0x124
github.com/go-rod/rod.(*Page).MustWaitStable(0x1400014e000)
        /Users/pjdhunt/go/pkg/mod/github.com/go-rod/[email protected]/must.go:451 +0xf0
main.main()
        /Users/pjdhunt/workspace_strata/okta-disco/cmd/rod/main.go:69 +0x4a4
Exiting.

Rod Version: v0.116.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions