Skip to content

Commit 00228e0

Browse files
committed
added option to fix choppy firefox scroll
1 parent bdf654a commit 00228e0

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

content_scripts/scroller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const performScroll = function(element, direction, amount) {
6161
const axisName = scrollProperties[direction].axisName;
6262
const before = element[axisName];
6363
if (element.scrollBy) {
64-
const scrollArg = {behavior: "instant"};
64+
const scrollArg = {behavior: Settings.get("scrollBehaviorSmooth") ? "smooth" : "instant"};
6565
scrollArg[direction === "x" ? "left" : "top"] = amount;
6666
element.scrollBy(scrollArg);
6767
} else {

lib/settings.js

+1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ const Settings = {
177177
defaults: {
178178
scrollStepSize: 60,
179179
smoothScroll: true,
180+
scrollBehaviorSmooth: false,
180181
keyMappings: "# Insert your preferred key mappings here.",
181182
linkHintCharacters: "sadfjklewcmpgh",
182183
linkHintNumbers: "0123456789",

pages/options.html

+14
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,20 @@
136136
</label>
137137
</td>
138138
</tr>
139+
<tr>
140+
<td class="caption"></td>
141+
<td verticalAlign="top" class="booleanOption">
142+
<div class="help">
143+
<div class="example">
144+
Fixes choppy scroll in Firefox when privacy.resistFingerprinting is set true
145+
</div>
146+
</div>
147+
<label>
148+
<input id="scrollBehaviorSmooth" type="checkbox"/>
149+
Use alternative smooth scroll (Firefox fix)
150+
</label>
151+
</td>
152+
</tr>
139153
<tr>
140154
<td class="caption"></td>
141155
<td verticalAlign="top" class="booleanOption">

pages/options.js

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ const Options = {
252252
ignoreKeyboardLayout: CheckBoxOption,
253253
scrollStepSize: NumberOption,
254254
smoothScroll: CheckBoxOption,
255+
scrollBehaviorSmooth: CheckBoxOption,
255256
grabBackFocus: CheckBoxOption,
256257
searchEngines: TextOption,
257258
searchUrl: NonEmptyTextOption,

0 commit comments

Comments
 (0)