diff options
author | anekos | 2012-12-20 20:08:41 +0900 |
---|---|---|
committer | anekos | 2012-12-20 20:08:41 +0900 |
commit | da3108fcea119f05d98caae3552654c095ad7601 (patch) | |
tree | 4793c8dba1dee59ffdfe8fd3faa906e454e59edf | |
parent | 98527df8e277b7e1656bf6debd20946f7cc5fa4f (diff) | |
download | vimperator-plugins-da3108fcea119f05d98caae3552654c095ad7601.tar.bz2 |
For new firefox.
-rw-r--r-- | erection.js | 4 | ||||
-rw-r--r-- | lo.js | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/erection.js b/erection.js index be7e1d2..303ac8d 100644 --- a/erection.js +++ b/erection.js @@ -152,14 +152,14 @@ let INFO = } } - Store.set('version', VERSION); + Store.set('version', String(VERSION)); Store.set('erections', erections); Store.save(); return callback(erections); } - if (VC.compare(Store.get('version'), VERSION) == 0) { + if (VC.compare(Store.get('version'), String(VERSION)) == 0) { //liberator.log('Get erections from Cache'); callback(Store.get('erections')); return; @@ -188,8 +188,8 @@ let INFO = function constant (value) function () value; - function isHttpLink (link) - (link.href && link.href.indexOf('http') == 0); + function isHttpOrFileLink (link) + (link.href && ((link.href.indexOf('http') == 0) || (/^file:/.test(link.href)))); function isCurrent (link) (link.href === buffer.URL); @@ -203,7 +203,7 @@ let INFO = function getLinks (includeCurrent) { function _get (content) Array.prototype.concat.apply(Array.slice(content.document.links), Array.slice(content.frames).map(_get)); - return _get(content).filter(isHttpLink).filter(includeCurrent ? constant(true) : not(isCurrent)); + return _get(content).filter(isHttpOrFileLink).filter(includeCurrent ? constant(true) : not(isCurrent)); } function makeRegExp (str) { |