aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/link_hints.coffee11
1 files changed, 9 insertions, 2 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index c86eabf1..b5fa527d 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -811,9 +811,16 @@ LocalHints =
nonOverlappingElements.push visibleElement unless visibleElement.secondClassCitizen
# Position the rects within the window.
+ if getComputedStyle(document.documentElement).position == "static"
+ top = window.scrollY
+ left = window.scrollX
+ else
+ rect = document.documentElement.getBoundingClientRect()
+ top = -rect.top
+ left = -rect.left
for hint in nonOverlappingElements
- hint.rect.top += window.scrollY
- hint.rect.left += window.scrollX
+ hint.rect.top += top
+ hint.rect.left += left
if Settings.get "filterLinkHints"
@withLabelMap (labelMap) =>