Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ferrum needs to listen DOM.documentUpdated in order to use NodeId values properly #86

Open
betelgeuse opened this issue Jun 5, 2020 · 1 comment

Comments

@betelgeuse
Copy link
Contributor

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-documentUpdated

Problem

Since ferrum tracks node ids in frontend but does not listen to DOM.documentUpdated it's possible that the following sequence of events happens:

  1. Ferrum::Node has node_id in memory
  2. DOM.documentUpdated happens
  3. calling methods on the node returns information for a new node that has matching id
    1. this would happen because they seem to start again from zero so they are not unique during single session

Fix

Make all Node objects listen to DOM.documentUpdated after which the objects should become stale so that all new commands issued with the node raise an exception.

@brutuscat
Copy link

👍 on this, documentation states:

Fired when Document has been totally updated. Node ids are no longer valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants