khloke / play-to-xbmc-chrome

A Google Chrome Extension for sending online content to be played on XBMC. Supported websites include YouTube, Vimeo, CollegeHumor, DailyMotion, eBaumsWorld and SoundCloud.
MIT License
186 stars 112 forks source link

Error in console #121

Open anoakie opened 7 years ago

anoakie commented 7 years ago

I randomly see this in my error console:

context-menu-content-scripts.js:41 Uncaught TypeError: event.target[matches] is not a function
    at HTMLDocument.<anonymous> (context-menu-content-scripts.js:41)
(anonymous) @ context-menu-content-scripts.js:41
anoakie commented 7 years ago

More information. It's triggered by a MouseEvent in Chrome (removed unrelated data)

MouseEvent
  currentTarget: document
  eventPhase: 2
  fromElement: null
  isTrusted: true
  path:(2) [document, Window]
  relatedTarget: null
  srcElement: document
  target: document
  toElement: document
  type: "mouseover"
anoakie commented 7 years ago

In the context of the exception:

matches = "matches"
selector = "a, a *"
mattmattmatt commented 7 years ago

Any update on this, @khloke? That error is really annoying when developing on websites, and it's preventable with this commit by @JohnyGemityg.

maciex commented 7 years ago

What about the second occurrance of the event.target[matches)() call in the document.addEventListener('mouseout') event handling? Maybe this one should be also checked before calling?