From da3108fcea119f05d98caae3552654c095ad7601 Mon Sep 17 00:00:00 2001 From: anekos Date: Thu, 20 Dec 2012 20:08:41 +0900 Subject: For new firefox. --- lo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lo.js') diff --git a/lo.js b/lo.js index e12cb28..1159a3b 100644 --- a/lo.js +++ b/lo.js @@ -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) { -- cgit v1.2.3