Skip to content

Commit ba5dcd4

Browse files
authored
Removed advanced settings scrolling animation on Firefox (#326)
1 parent c945164 commit ba5dcd4

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "random-youtube-video",
3-
"version": "3.1.13",
3+
"version": "3.1.13.1",
44
"description": "Customize, shuffle and play random videos from any YouTube channel.",
55
"scripts": {
66
"dev": "concurrently \"npm run dev:chromium\" \"npm run dev:firefox\"",

src/html/htmlUtils.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Shared utility functions for the various HTML pages' logic
2-
import { shufflingHints } from "../config.js";
2+
import { isFirefox, shufflingHints } from "../config.js";
33

44
// ----- Shuffling Hints -----
55
export async function buildShufflingHints(domElements) {
@@ -54,17 +54,21 @@ export function animateSlideOut(targetElement, shouldSlideOut = null) {
5454
}
5555
}
5656

57-
requestAnimationFrame(scrollStep);
57+
if (!isFirefox) {
58+
requestAnimationFrame(scrollStep);
59+
}
5860
}, 0);
5961

60-
targetElement.addEventListener(
61-
"transitionend",
62-
function () {
63-
// Ensure the page is scrolled to the bottom after the animation
64-
window.scrollTo(0, document.body.scrollHeight);
65-
}, {
66-
once: true
67-
});
62+
if (!isFirefox) {
63+
targetElement.addEventListener(
64+
"transitionend",
65+
function () {
66+
// Ensure the page is scrolled to the bottom after the animation
67+
window.scrollTo(0, document.body.scrollHeight);
68+
}, {
69+
once: true
70+
});
71+
}
6872
} else {
6973
// Sliding in
7074
const oldHeight = targetElement.clientHeight;

static/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Random YouTube Video",
33
"description": "Customize, shuffle and play random videos from any YouTube channel.",
4-
"version": "3.1.13",
4+
"version": "3.1.13.1",
55
"version_name": "3.1.13",
66
"manifest_version": 3,
77
"content_scripts": [

0 commit comments

Comments
 (0)