{"action":"created","issue":{"url":"https://api.github.com/repos/1995eaton/chromium-vim/issues/397","labels_url":"https://api.github.com/repos/1995eaton/chromium-vim/issues/397/labels{/name}","comments_url":"https://api.github.com/repos/1995eaton/chromium-vim/issues/397/comments","events_url":"https://api.github.com/repos/1995eaton/chromium-vim/issues/397/events","html_url":"https://github.com/1995eaton/chromium-vim/issues/397","id":126211678,"number":397,"title":"There seems to be no way to click the non-anchor tags","user":{"login":"ArtBIT","id":184220,"avatar_url":"https://avatars.githubusercontent.com/u/184220?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtBIT","html_url":"https://github.com/ArtBIT","followers_url":"https://api.github.com/users/ArtBIT/followers","following_url":"https://api.github.com/users/ArtBIT/following{/other_user}","gists_url":"https://api.github.com/users/ArtBIT/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtBIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtBIT/subscriptions","organizations_url":"https://api.github.com/users/ArtBIT/orgs","repos_url":"https://api.github.com/users/ArtBIT/repos","events_url":"https://api.github.com/users/ArtBIT/events{/privacy}","received_events_url":"https://api.github.com/users/ArtBIT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-12T16:02:05Z","updated_at":"2016-01-23T13:35:09Z","closed_at":null,"body":"Is there a way to `createHint` for non `<a>` elements, like `<div>`, that have `click` event listeners bound to them?"},"comment":{"url":"https://api.github.com/repos/1995eaton/chromium-vim/issues/comments/174187194","html_url":"https://github.com/1995eaton/chromium-vim/issues/397#issuecomment-174187194","issue_url":"https://api.github.com/repos/1995eaton/chromium-vim/issues/397","id":174187194,"user":{"login":"ArtBIT","id":184220,"avatar_url":"https://avatars.githubusercontent.com/u/184220?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtBIT","html_url":"https://github.com/ArtBIT","followers_url":"https://api.github.com/users/ArtBIT/followers","following_url":"https://api.github.com/users/ArtBIT/following{/other_user}","gists_url":"https://api.github.com/users/ArtBIT/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtBIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtBIT/subscriptions","organizations_url":"https://api.github.com/users/ArtBIT/orgs","repos_url":"https://api.github.com/users/ArtBIT/repos","events_url":"https://api.github.com/users/ArtBIT/events{/privacy}","received_events_url":"https://api.github.com/users/ArtBIT/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T13:35:09Z","updated_at":"2016-01-23T13:35:09Z","body":"Finding all clickable elements that have an `onclick` attribute is trivial:\r\n```javascript\r\nvar\r\nelements = [],\r\n    n,\r\n    types = ['onclick', 'ondblclick', 'onmousedown' /*, ... */ ],\r\n    all = document.querySelectorAll('[' + types.join('],[') + ']'),\r\n    i=all.length, j;\r\nwhile (i--) {\r\n  j = types.length;\r\n  while (j--) {\r\n    if (typeof all[i][types[j]] == 'function') {\r\n      elements.push({\r\n        \"node\": all[i],\r\n        \"type\": types[j]\r\n      });\r\n    }\r\n  }\r\n}\r\n```\r\nBut then it gets ugly.\r\nTo get all the events that are attached via `addEventListener`, we'd need to monkey-patch the `addEventListener` method to expose some sort of event listener list:\r\n```javascript\r\n  Element.prototype._addEventListener = Element.prototype.addEventListener;\r\n  Element.prototype.addEventListener = function(a,b,c) {\r\n    this._addEventListener(a,b,c);\r\n    if (!this.eventListenerList) this.eventListenerList = {};\r\n    if (!this.eventListenerList[a]) this.eventListenerList[a] = [];\r\n    this.eventListenerList[a].push(b);\r\n  };\r\n  // but we also need to handle removeEventListener\r\n  Element.prototype._removeEventListener = Element.prototype.removeEventListener;\r\n  Element.prototype.removeEventListener = function(a,b,c) {\r\n    this._removeEventListener(a,b,c);\r\n    if (this.eventListenerList && this.eventListenerList[a]) {\r\n        var i = this.eventListenerList[a].length;\r\n        while(i--) {\r\n          if (this.eventListenerList[a][i] == b) {\r\n              this.eventListenerList[a].slice(i,1);\r\n              return;\r\n          }\r\n        }\r\n    }\r\n  };\r\n```\r\nThen, there are custom libraries like jQuery, Prototype, etc. that might need custom handling, and I can see how this could get messy soon.\r\n\r\nBut still, it would be nice to have this feature."}}