aboutsummaryrefslogtreecommitdiffstats
path: root/js/matrix.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/matrix.js')
-rw-r--r--js/matrix.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/js/matrix.js b/js/matrix.js
index 6af5ab1..9a74cc7 100644
--- a/js/matrix.js
+++ b/js/matrix.js
@@ -21,7 +21,6 @@
uMatrix Home: https://github.com/gorhill/uMatrix
*/
-/* global punycode */
/* jshint bitwise: false */
'use strict';
@@ -30,6 +29,9 @@
ηMatrix.Matrix = (function() {
+ Cu.import('chrome://ematrix/content/lib/Punycode.jsm');
+ Cu.import('chrome://ematrix/content/lib/UriTools.jsm');
+
/******************************************************************************/
var ηm = ηMatrix;
@@ -179,7 +181,7 @@
if ( srcHostname === '*' || desHostname === '*' || desHostname === '1st-party' ) {
return '';
}
- var ηmuri = ηm.URI;
+ var ηmuri = UriTools;
var srcDomain = ηmuri.domainFromHostname(srcHostname) || srcHostname;
var desDomain = ηmuri.domainFromHostname(desHostname) || desHostname;
return desDomain === srcDomain ? desDomain : '';
@@ -607,8 +609,8 @@
val = this.evaluateCell(srcHostname, desHostname, type);
if ( val === 0 ) { continue; }
out.push(
- punycode.toUnicode(srcHostname) + ' ' +
- punycode.toUnicode(desHostname) + ' ' +
+ Punycode.toUnicode(srcHostname) + ' ' +
+ Punycode.toUnicode(desHostname) + ' ' +
type + ' ' +
stateToNameMap.get(val)
);
@@ -694,7 +696,7 @@
switchName = fieldVal.slice(0, pos);
}
if ( switchBitOffsets.has(switchName) ) {
- srcHostname = punycode.toASCII(fields[1]);
+ srcHostname = Punycode.toASCII(fields[1]);
// No state field: reject
fieldVal = fields[2];
@@ -737,8 +739,8 @@
// Lines with invalid syntax silently ignored
- srcHostname = punycode.toASCII(fields[0]);
- desHostname = punycode.toASCII(fields[1]);
+ srcHostname = Punycode.toASCII(fields[0]);
+ desHostname = Punycode.toASCII(fields[1]);
fieldVal = fields[2];