mirror of https://github.com/gorhill/uBlock.git
be ready for when Element.matches is not supported
This commit is contained in:
parent
865ff3e01b
commit
d098edf2e3
|
@ -239,7 +239,15 @@ var FilterParser = function() {
|
||||||
this.invalid = false;
|
this.invalid = false;
|
||||||
this.cosmetic = true;
|
this.cosmetic = true;
|
||||||
this.reParser = /^\s*([^#]*)(##|#@#)(.+)\s*$/;
|
this.reParser = /^\s*([^#]*)(##|#@#)(.+)\s*$/;
|
||||||
|
|
||||||
|
// Not all browsers support `Element.matches`:
|
||||||
|
// http://caniuse.com/#feat=matchesselector
|
||||||
this.div = document.createElement('div');
|
this.div = document.createElement('div');
|
||||||
|
if ( typeof this.div.matches !== 'function' ) {
|
||||||
|
this.div = {
|
||||||
|
matches: function() { return true; }
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue