[BugFix] - pressing reset key doesn't stick on sites with per-site speed rules#1506
Open
kevinlabs wants to merge 1 commit intoigrigorik:masterfrom
Open
[BugFix] - pressing reset key doesn't stick on sites with per-site speed rules#1506kevinlabs wants to merge 1 commit intoigrigorik:masterfrom
kevinlabs wants to merge 1 commit intoigrigorik:masterfrom
Conversation
…ite speed rules - Reset to 1.0x gets undone when pausing, scrubbing, or looping on sites with a custom speed rule (e.g. youtube.com at 2.0x) - Root cause: getTargetSpeed() couldn't tell the difference between "user pressed reset" and "page just loaded" when lastSpeed is 1.0 - Added userSpeedOverride flag to track when user has explicitly chosen a speed, so site defaults don't overwrite it - Flag is session-only, resets on page load so fresh loads still apply site rules correctly - Added tests for both the fix and the fresh-load behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
speed rule (e.g. youtube.com set to 2.0x)
userSpeedOverrideflag so the extension knows when a user hasexplicitly chosen a speed vs a fresh page load default
How to reproduce
youtube.comwith speed2.0Rto reset — speed drops to 1.0xRoot cause
getTargetSpeed()treatedlastSpeed === 1.0as "no deliberate userchoice" and fell back to the site baseline. Pressing reset IS a deliberate
choice for 1.0, but the code couldn't distinguish it from a fresh page load.
Fix
setSpeed()now setsuserSpeedOverride = trueon user actionsgetTargetSpeed()checks this flag first — if the user has acted,return their chosen speed regardless of value
apply site rules correctly
Tests