diff options
| author | Stephen Blott | 2017-09-12 11:54:28 +0100 |
|---|---|---|
| committer | GitHub | 2017-09-12 11:54:28 +0100 |
| commit | 23425118b80239b99f4d9a71727bd6ce65c8794e (patch) | |
| tree | 38d7ca7bf55bc0c15d80d0908b9b2176d9c76d86 /lib | |
| parent | f3b186c0228f68e15e6c8d2aad53c227efb187f4 (diff) | |
| parent | 263a7c63ded6289242263601ed014fe8447876dc (diff) | |
| download | vimium-23425118b80239b99f4d9a71727bd6ce65c8794e.tar.bz2 | |
Merge pull request #2637 from mrmr1993/linkhints-scaled-display-fix
Exclude Firefox from the scaled DPI fix
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dom_utils.coffee | 3 | ||||
| -rw-r--r-- | lib/utils.coffee | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 24747837..c8ddcedf 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -293,7 +293,8 @@ DomUtils = style = getComputedStyle box if style.position == "static" and not /content|paint|strict/.test(style.contain or "") zoom = +style.zoom || 1 - ratio = window.devicePixelRatio ? 1 + ratio = window.devicePixelRatio + ratio = 1 if Utils.isFirefox() or not ratio? top: Math.ceil(window.scrollY * ratio / zoom), left: Math.ceil(window.scrollX * ratio / zoom) else rect = box.getBoundingClientRect() diff --git a/lib/utils.coffee b/lib/utils.coffee index 78eed12c..93cc3246 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -7,6 +7,13 @@ window.forTrusted ?= (handler) -> (event) -> true Utils = + isFirefox: do -> + # NOTE(mrmr1993): This test only works in the background page, this is overwritten by isEnabledForUrl for + # content scripts. + isFirefox = false + browser?.runtime?.getBrowserInfo?()?.then? (browserInfo) -> + isFirefox = browserInfo?.name == "Firefox" + -> isFirefox getCurrentVersion: -> chrome.runtime.getManifest().version |
