Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to use scrollBehavior:smooth to fix choppy firefox scroll when resistFingerprinting is enabled #3701

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content_scripts/scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const performScroll = function(element, direction, amount) {
const axisName = scrollProperties[direction].axisName;
const before = element[axisName];
if (element.scrollBy) {
const scrollArg = {behavior: "instant"};
const scrollArg = {behavior: Settings.get("scrollBehaviorSmooth") ? "smooth" : "instant"};
scrollArg[direction === "x" ? "left" : "top"] = amount;
element.scrollBy(scrollArg);
} else {
Expand Down
1 change: 1 addition & 0 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ const Settings = {
defaults: {
scrollStepSize: 60,
smoothScroll: true,
scrollBehaviorSmooth: false,
keyMappings: "# Insert your preferred key mappings here.",
linkHintCharacters: "sadfjklewcmpgh",
linkHintNumbers: "0123456789",
Expand Down
14 changes: 14 additions & 0 deletions pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@
</label>
</td>
</tr>
<tr>
<td class="caption"></td>
<td verticalAlign="top" class="booleanOption">
<div class="help">
<div class="example">
Fixes choppy scroll in Firefox when privacy.resistFingerprinting is set true
</div>
</div>
<label>
<input id="scrollBehaviorSmooth" type="checkbox"/>
Use alternative smooth scroll (Firefox fix)
</label>
</td>
</tr>
<tr>
<td class="caption"></td>
<td verticalAlign="top" class="booleanOption">
Expand Down
1 change: 1 addition & 0 deletions pages/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ const Options = {
ignoreKeyboardLayout: CheckBoxOption,
scrollStepSize: NumberOption,
smoothScroll: CheckBoxOption,
scrollBehaviorSmooth: CheckBoxOption,
grabBackFocus: CheckBoxOption,
searchEngines: TextOption,
searchUrl: NonEmptyTextOption,
Expand Down