diff options
author | Jesús <heckyel@hyperbola.info> | 2019-12-30 15:55:13 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-12-30 15:55:13 -0500 |
commit | 288df6a7bf8b933e2dc499e38f4915fcf974c14b (patch) | |
tree | 77bba994f260c064d3ee7f76c427ddfaa4f91710 /js/matrix.js | |
parent | a2c9deaa145b780722e93b3899600f287c8094a4 (diff) | |
download | ematrix-288df6a7bf8b933e2dc499e38f4915fcf974c14b.tar.lz ematrix-288df6a7bf8b933e2dc499e38f4915fcf974c14b.tar.xz ematrix-288df6a7bf8b933e2dc499e38f4915fcf974c14b.zip |
backport
- Flush caches on upgrade
- Properly handle FrameModule's unloading
- Use the new module and remove the old implementation
Diffstat (limited to 'js/matrix.js')
-rw-r--r-- | js/matrix.js | 16 |
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]; |