I know this problem is outdated, but I ran into it when debugging in Internet Explorer 11. I updated the previous whackWebkitMatchesSelector to include IE code:
function whackWebkitMatchesSelector() { var oldMatches; if (Element.prototype.msMatchesSelector) { oldMatches = Element.prototype.msMatchesSelector; Element.prototype.msMatchesSelector = function(selector) { try { return oldMatches.call(this, selector); } catch (err) { return false; } }; } else if (Element.prototype.webkitMatchesSelector) { oldMatches = Element.prototype.webkitMatchesSelector; Element.prototype.webkitMatchesSelector = function(selector) { try { return oldMatches.call(this, selector); } catch (err) { return false; } }; } } whackWebkitMatchesSelector();
source share