Skip to content

Commit 89ed0d0

Browse files
authored
Fixed some layouting issues (#222)
1 parent ce197cd commit 89ed0d0

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Changelog
22

3-
## v2.2.3
3+
## v2.2.4
44

55
<!--Releasenotes start-->
6+
- Fixed an alignment issue of the shuffle button on channel pages that was introduced with the latest update to the YouTube UI.
7+
- Fixed some issues with the display of the shuffle button if the shuffle icon is not loaded in time.
8+
<!--Releasenotes end-->
9+
10+
## v2.2.3
11+
612
- Error messages now include the current channel ID to help with reporting an issue.
713
- Some changes in how data that is sent to the database is handled, to prepare for a future security update.
8-
<!--Releasenotes end-->
914

1015
## v2.2.2
1116

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": "2.2.3",
3+
"version": "2.2.4",
44
"description": "Play a random video uploaded on the current YouTube channel.",
55
"scripts": {
66
"dev": "concurrently \"npm run dev:chromium\" \"npm run dev:firefox\"",

src/buildShuffleButton.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function buildShuffleButton(pageType, channelId, clickHandler) {
88
let buttonDivID = "youtube-random-video-shuffle-button";
99
let buttonDivExtraStyle = "";
1010
let buttonDivOwner = null;
11-
let buttonDivPrepend = true;
11+
let buttonDivAppend = true;
1212

1313
// Depending on the type of page we're on, we might need to change certain parts of the button
1414
switch (pageType) {
@@ -20,7 +20,6 @@ export function buildShuffleButton(pageType, channelId, clickHandler) {
2020
buttonDivID = "youtube-random-video-shuffle-button-video";
2121
buttonDivExtraStyle = "margin-left: 8px;";
2222
buttonDivOwner = document.getElementById("above-the-fold").children.namedItem("top-row").children.namedItem("owner");
23-
buttonDivPrepend = false;
2423
break;
2524
default:
2625
console.warn(`Cannot build button: Unknown page type: ${pageType}`);
@@ -69,11 +68,11 @@ export function buildShuffleButton(pageType, channelId, clickHandler) {
6968
</div>`;
7069
buttonDiv = new DOMParser().parseFromString(buttonDiv, "text/html").body.firstChild;
7170

72-
// Depending on the page we're on, we wat to prepend or append the button to the owner
73-
if (buttonDivPrepend) {
74-
buttonDivOwner.prepend(buttonDiv);
75-
} else {
71+
// Depending on the page we're on, we may want to prepend or append the button to the parent
72+
if (buttonDivAppend) {
7673
buttonDivOwner.appendChild(buttonDiv);
74+
} else {
75+
buttonDivOwner.prepend(buttonDiv);
7776
}
7877

7978
// Wait for the button renderer to get the child elements defined by the element type
@@ -117,7 +116,7 @@ function finalizeButton(pageType, channelId, clickHandler) {
117116
<button
118117
class="yt-spec-button-shape-next yt-spec-button-shape-next--tonal yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m"
119118
aria-label="Shuffle from this channel">
120-
<span class="material-symbols-outlined">
119+
<span class="material-symbols-outlined" style="width: 24.01px; overflow: hidden;">
121120
shuffle
122121
</span>
123122
<div class="cbox yt-spec-button-shape-next--button-text-content">

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": "Play a random video uploaded on the current YouTube channel.",
4-
"version": "2.2.3",
4+
"version": "2.2.4",
55
"manifest_version": 3,
66
"content_scripts": [
77
{

0 commit comments

Comments
 (0)