{"action":"opened","issue":{"url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/342","repository_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface","labels_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/342/comments","events_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/342/events","html_url":"https://github.com/cyrus-and/chrome-remote-interface/issues/342","id":322553609,"number":342,"title":"Triggering events on dynamically discovered elements","user":{"login":"pmurley","id":2295951,"avatar_url":"https://avatars0.githubusercontent.com/u/2295951?v=4","gravatar_id":"","url":"https://api.github.com/users/pmurley","html_url":"https://github.com/pmurley","followers_url":"https://api.github.com/users/pmurley/followers","following_url":"https://api.github.com/users/pmurley/following{/other_user}","gists_url":"https://api.github.com/users/pmurley/gists{/gist_id}","starred_url":"https://api.github.com/users/pmurley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmurley/subscriptions","organizations_url":"https://api.github.com/users/pmurley/orgs","repos_url":"https://api.github.com/users/pmurley/repos","events_url":"https://api.github.com/users/pmurley/events{/privacy}","received_events_url":"https://api.github.com/users/pmurley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-13T00:42:32Z","updated_at":"2018-05-13T00:42:32Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPlease make sure to have searched for existing issues before opening new ones:\r\n    https://github.com/cyrus-and/chrome-remote-interface/issues?q=\r\n\r\nYou may also want to check the FAQ section of the README:\r\n    https://github.com/cyrus-and/chrome-remote-interface#faq\r\n\r\nAlright then, please provide the following information along with a detailed\r\ndescription of what went wrong.\r\n\r\nIf appropriate, attach a MINIMAL STANDALONE SCRIPT to help to reproduce your\r\nissue. (Use fenced blocks to display JavaScript code like this: ```js)\r\n-->\r\n\r\n| Component | Version\r\n|-|-\r\n| Operating system\t  \t \t| Ubuntu 16.04\r\n| Node.js\t\t\t\t\t| 9.11.1\r\n| Chrome/Chromium/...\t\t| 67\r\n| chrome-remote-interface\t| 0.25.5\r\n\r\nIs Chrome running in a container? NO\r\n\r\nI'm writing a crawler and trying to get it to trigger input-based events (clicks, hovers, focus/blur, key presses) automatically for an arbitrary site. I'm walking the DOM tree and calling `DOMDebugger.getEventListeners` on each node, and I am able to successfully get all the listeners. However, I'm having some trouble triggering the events themselves. I'd like to be able to just do:\r\n\r\n```js\r\nRuntime.evaluate({expression: \"document.getElementById('something').blur()\"});\r\n```\r\n\r\nbut I can't, because I don't have the 'something'. For some events (at least focus and click) I can get this done with `Input` or `DOM.focus()`, but it seems it would be way easier if there was a way to get hold of the element in some injected JavaScript.\r\n\r\nIs there an easy way to do this? Am I going about it the wrong way?\r\n\r\nThanks for your time.\r\n\r\n"}}
{"actor":{"display_login":"pmurley"}}