-
-
Notifications
You must be signed in to change notification settings - Fork 430
Open
Description
Rod Version: v0.116.2
If you set a context on a browser and then call Pages(), it'll set page contexts to browser context (with extra cancel (which stops being relevant the moment you call Context() on a page)) and also set browser pointer to itself, which is fine for that call, but then it'll cache these values. If you later set another context and call Pages() again, all old pages will return with old context (possibly cancelled already).
Cloning cached pages and setting context to current browser context doesn't solve it completely for two reasons:
Page.Info(),Page.Activate()andPage.TriggerFavicon()disregard page context and use browser context instead (and cached pages have old browser pointers with old context) (but this is trivial to fix, other methods already usep.browser.Context(p.ctx))- Pages have pointers to input devices which have mutexes and state, and can't be cloned as is (probably can be decoupled so mutex and state are in one place and pointer to a page is in the other, and only the pointer part is cloned). And also there's
rootpage and element for iframe, which might cause similar issues too.
Imo explicitly passing context to all blocking functions is better than including context in objects (much more predictable and not as convoluted).
Metadata
Metadata
Assignees
Labels
No labels