diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index 3781b6d2d..4c4195033 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -239,7 +239,15 @@ var FilterParser = function() { this.invalid = false; this.cosmetic = true; this.reParser = /^\s*([^#]*)(##|#@#)(.+)\s*$/; + + // Not all browsers support `Element.matches`: + // http://caniuse.com/#feat=matchesselector this.div = document.createElement('div'); + if ( typeof this.div.matches !== 'function' ) { + this.div = { + matches: function() { return true; } + }; + } }; /******************************************************************************/