|
@ -118,7 +118,7 @@ var processUserRules = function(response) { |
|
|
var fromRequestPolicy = function(content) { |
|
|
var fromRequestPolicy = function(content) { |
|
|
var matches = /\[origins-to-destinations\]([^\[]+)/.exec(content); |
|
|
var matches = /\[origins-to-destinations\]([^\[]+)/.exec(content); |
|
|
if ( matches === null || matches.length !== 2 ) { |
|
|
if ( matches === null || matches.length !== 2 ) { |
|
|
return ''; |
|
|
|
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
return matches[1].trim() |
|
|
return matches[1].trim() |
|
|
.replace(/\|/g, ' ') |
|
|
.replace(/\|/g, ' ') |
|
@ -143,7 +143,7 @@ var fromNoScript = function(content) { |
|
|
typeof noscript.whitelist !== 'string' || |
|
|
typeof noscript.whitelist !== 'string' || |
|
|
typeof noscript.V !== 'string' |
|
|
typeof noscript.V !== 'string' |
|
|
) { |
|
|
) { |
|
|
return ''; |
|
|
|
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
var out = {}; |
|
|
var out = {}; |
|
|
var reBad = /[a-z]+:\w*$/; |
|
|
var reBad = /[a-z]+:\w*$/; |
|
@ -176,12 +176,13 @@ var handleImportFilePicker = function() { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
var result = fromRequestPolicy(this.result); |
|
|
var result = fromRequestPolicy(this.result); |
|
|
if ( result === '' ) { |
|
|
|
|
|
|
|
|
if ( result === undefined ) { |
|
|
result = fromNoScript(this.result); |
|
|
result = fromNoScript(this.result); |
|
|
if ( result === '' ) { |
|
|
|
|
|
|
|
|
if ( result === undefined ) { |
|
|
result = this.result; |
|
|
result = this.result; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if ( this.result === '' ) { return; } |
|
|
var request = { |
|
|
var request = { |
|
|
'what': 'setUserRules', |
|
|
'what': 'setUserRules', |
|
|
'temporaryRules': rulesFromHTML('#diff .right li') + '\n' + result |
|
|
'temporaryRules': rulesFromHTML('#diff .right li') + '\n' + result |
|
|