mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-19 16:27:58 +01:00
Trim sitefilters.
This commit is contained in:
@@ -453,7 +453,7 @@ var Option = Class("Option", {
|
|||||||
result = undefined;
|
result = undefined;
|
||||||
|
|
||||||
let [, bang, filter] = /^(!?)(.*)/.exec(pattern);
|
let [, bang, filter] = /^(!?)(.*)/.exec(pattern);
|
||||||
filter = Option.dequote(filter);
|
filter = Option.dequote(filter).trim();
|
||||||
|
|
||||||
let quote = this.keepQuotes ? util.identity : Option.quote;
|
let quote = this.keepQuotes ? util.identity : Option.quote;
|
||||||
|
|
||||||
|
|||||||
@@ -420,6 +420,8 @@ var Styles = Module("Styles", {
|
|||||||
* @returns {nsIURI -> boolean}
|
* @returns {nsIURI -> boolean}
|
||||||
*/
|
*/
|
||||||
matchFilter: function (filter) {
|
matchFilter: function (filter) {
|
||||||
|
filter = filter.trim();
|
||||||
|
|
||||||
if (filter === "*")
|
if (filter === "*")
|
||||||
var test = function test(uri) true;
|
var test = function test(uri) true;
|
||||||
else if (!/^(?:[a-z-]+:|[a-z-.]+$)/.test(filter)) {
|
else if (!/^(?:[a-z-]+:|[a-z-.]+$)/.test(filter)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user