summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2019-08-04 01:52:27 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2019-08-04 01:52:27 +0300
commitcfb5f0b9e1acdf0b9595b819248127b3aa66957f (patch)
tree9ab09789fb80516a3eeff04556f6ad147faaa8c3 /ext
parent567b136f5f004ee887cf9a8bd950b2286fd5ddab (diff)
fix scanning start of line on Firefox
On many sites, for example Twitter (posts), Yomichan doesn't match any text from the beginning of the line unless you move the mouse cursor to the top left corner of the word that starts from the beginning of the line. Apparently there were some problems related to the imposter and there was commit 0cc5566 adding a fix for it, but this seemed to cause problems and 542cdb2 was added to fix that. It didn't handle all of the cases, though, so this commit is letting everything through on Firefox.
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/js/document.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js
index 5dcf7b3d..f58a64fc 100644
--- a/ext/fg/js/document.js
+++ b/ext/fg/js/document.js
@@ -102,6 +102,10 @@ function docRangeFromPoint(point) {
return new TextSourceRange(range);
}
}
+
+ if (navigator.userAgent.match(/Firefox/)) {
+ return new TextSourceRange(range);
+ }
}
function docSentenceExtract(source, extent) {