Skip to content

Commit

Permalink
Merge pull request #42 from Thunderarea/dev
Browse files Browse the repository at this point in the history
New version 6.4.19
  • Loading branch information
Thunderarea authored Jan 13, 2025
2 parents 7b3970d + 51b3c8b commit ab43f0f
Show file tree
Hide file tree
Showing 19 changed files with 500 additions and 249 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./source/config.js
./source/manifest.json
6 changes: 6 additions & 0 deletions source/_locales/el/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
"OptionsMenuOptionDescription": {
"message": "Ενεργοποιήστε/Απενεργοποιήστε τις επιλογές για YouTube, YouTube Music και Άλλα sites για την τρέχουσα καρτέλα (και σελίδα) από το popup"
},
"controlFromPopup": {
"message": "Ρύθμιση της επέκτασης από το popup"
},
"controlFromPopupDescription": {
"message": "Επιτρέπει την ενεργοποίηση/απενεργοποίηση της λειτουργίας της επέκτασης από το popup (και τις συντομεύσεις πληκτρολογίου)"
},
"PopupExplanation": {
"message": "*το παράθυρο που εμφανίζεται όταν κάνετε κλικ στο εικονίδιο της επέκτασης"
},
Expand Down
6 changes: 6 additions & 0 deletions source/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
"OptionsMenuOptionDescription": {
"message": "Enable/Disable the options of YouTube, YouTube Music, and Other Sites for the current tab (and page) from the popup"
},
"controlFromPopup": {
"message": "Control the extension from the popup"
},
"controlFromPopupDescription": {
"message": "Allow enabling/disabling the extension from the popup (and the shortcuts)"
},
"PopupExplanation": {
"message": "*the window that appears when you click the extension's icon"
},
Expand Down
17 changes: 16 additions & 1 deletion source/css/channel_avatars.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ytd-account-item-renderer img {
#author-thumbnail.ytd-backstage-post-renderer yt-img-shadow.ytd-backstage-post-renderer img,
#creator-thumbnail.ytd-comment-replies-renderer yt-img-shadow img,
#author-thumbnail.ytd-post-renderer yt-img-shadow.ytd-post-renderer img,
#author-thumbnail.ytd-comment-view-model yt-img-shadow img,
#author-photo img,
#hearted-thumbnail img,
#hearted-thumbnail img {
Expand All @@ -19,7 +20,8 @@ ytd-profile-column-user-info-renderer img,
ytd-channel-avatar-editor img,
.branding-img-container img,
#avatar img#img,
ytd-grid-channel-renderer img {
ytd-grid-channel-renderer img,
yt-avatar-shape img {
visibility: hidden !important;
}

Expand Down Expand Up @@ -68,4 +70,17 @@ ytd-grid-channel-renderer yt-img-shadow {

yt-live-chat-author-chip #chat-badges {
display: none !important;
}

/* The first is probably not used now */
yt-avatar-shape .yt-spec-avatar-shape--avatar-size-medium,
yt-avatar-shape .yt-spec-avatar-shape {
background-image: url('../img/avatar-chanell.svg') !important;
background-repeat: no-repeat !important;
background-position: center !important;
background-size: 100% 100% !important;
}

#avatar-container {
display: none !important;
}
4 changes: 3 additions & 1 deletion source/css/others.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ div.banner-visible-area {
display: none !important;
}

.page-header-banner {
/* The one with the classname it is probably not used now */
.page-header-banner,
#page-header-banner {
display: none !important;
}

Expand Down
13 changes: 11 additions & 2 deletions source/css/video_thumbnails2.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ ytd-radio-renderer img,
ytd-video-renderer img,
ytd-playlist-panel-supported-items img,
ytd-playlist-panel-video-renderer img,
ytd-rich-item-renderer img {
ytd-rich-item-renderer #thumbnail img,
ytd-reel-shelf-renderer img,
yt-content-preview-image-view-model img {
display: none !important;
}

Expand All @@ -185,7 +187,8 @@ ytd-rich-movie-renderer ytd-thumbnail {

ytd-thumbnail #overlays,
ytd-grid-movie-renderer yt-img-shadow,
ytd-rich-movie-renderer yt-img-shadow {
ytd-rich-movie-renderer yt-img-shadow,
ytm-shorts-lockup-view-model > a > div {
background-image: url("../img/youtube_logo.svg") !important;
background-repeat: no-repeat !important;
background-position: center !important;
Expand Down Expand Up @@ -348,3 +351,9 @@ yt-thumbnail-overlay-badge-view-model yt-thumbnail-badge-view-model badge-shape
align-items: center !important;
padding: 0 !important;
}

/* Image of playlist in playlist's page */
yt-content-preview-image-view-model thumbnail-hover-overlay-view-model {
opacity: 1 !important;
background-color: var(--yt-primary-color) !important;
}
21 changes: 13 additions & 8 deletions source/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ let extensionOptions = {
"google_search": false,

"theme": 2,
"control_from_popup": true,
"popup_current_page": false,
"popup_specific_options": false,

Expand Down Expand Up @@ -422,14 +423,18 @@ chrome.commands.onCommand.addListener(command => runOnCurrentTab(command));

function runOnCurrentTab(command, currentTabId = -1) {
if (command == "run_extension_tab") {
if (currentTabId === -1) {
chrome.tabs.query({
active: true,
currentWindow: true
}, tabs => {
if (tabs.length > 0) toglleStatusForTab(tabs[0].id);
});
} else toglleStatusForTab(currentTabId);
chrome.storage.local.get("control_from_popup", value => {
if (value.control_from_popup) {
if (currentTabId === -1) {
chrome.tabs.query({
active: true,
currentWindow: true
}, tabs => {
if (tabs.length > 0) toglleStatusForTab(tabs[0].id);
});
} else toglleStatusForTab(currentTabId);
}
});
}
}

Expand Down
15 changes: 11 additions & 4 deletions source/js/video_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,17 @@ try {
) {
return 0;
}
if (getValue("mmfytb_progress_bar")) {
if (url.indexOf("videoplayback") !== -1) {
let video = findVideoEl();
if (video) {
video.addEventListener("timeupdate", timeUpdate);
videoWithListener = video;
}
}
} else if (videoWithListener) {
videoWithListener.removeEventListener("timeupdate", timeUpdate);
}
}
}
return await origFetch(...args);
Expand All @@ -212,10 +223,6 @@ function musicModeForYouTube(url, isLive, firstCall) {
let video = findVideoEl();
if (video) {
setPlaybackRateAgain(video);
if (getValue("mmfytb_progress_bar")) {
video.addEventListener("timeupdate", timeUpdate);
videoWithListener = video;
} else video.removeEventListener("timeupdate", timeUpdate);
if (isLive != -1) {
if (isNotMusicUrl(video.src)) {
video.dataset.originalurl = video.src;
Expand Down
2 changes: 1 addition & 1 deletion source/manifest_chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Music Mode for YouTube™",
"short_name": "Music Mode",
"version": "6.4.8",
"version": "6.4.19",
"default_locale": "en",
"incognito":"spanning",

Expand Down
2 changes: 1 addition & 1 deletion source/manifest_firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Music Mode for YouTube™",
"short_name": "Music Mode",
"version": "1.2.8",
"version": "1.2.19",
"default_locale": "en",
"incognito":"spanning",

Expand Down
2 changes: 1 addition & 1 deletion source/pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<a href="about.html" class="menuLinks" data-i18n="about"></a>
<a href="options.html" class="menuLinks" data-i18n="options"></a>
<a href="contact.html" class="menuLinks" data-i18n="contact"></a>
<a href="https://www.paypal.com/donate?hosted_button_id=V2EHRNX8RBTX2" target="_blank" class="menuLinks"><span id="donation_menu_link" data-i18n="donation"></span></a>
<a href="donation.html" class="menuLinks"><span id="donation_menu_link" data-i18n="donation"></span></a>
</div>
</div>
<div id="bodyContainer">
Expand Down
2 changes: 1 addition & 1 deletion source/pages/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<a href="about.html" class="menuLinks" data-i18n="about"></a>
<a href="options.html" class="menuLinks" data-i18n="options"></a>
<a href="contact.html" class="menuLinks" data-i18n="contact"></a>
<a href="https://www.paypal.com/donate?hosted_button_id=V2EHRNX8RBTX2" target="_blank" class="menuLinks"><span id="donation_menu_link" data-i18n="donation"></span></a>
<a href="donation.html" class="menuLinks"><span id="donation_menu_link" data-i18n="donation"></span></a>
</div>
</div>
<div id="bodyContainer">
Expand Down
65 changes: 65 additions & 0 deletions source/pages/donation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.pageBody {
font-weight: 300;
font-size: 16px;
}

#payment_methods_container {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
color: grey;
}

@media (max-width: 600px) {
#payment_methods_container {
flex-direction: column;
gap: 5px;
}
}

#buymeacoffeeButton img:hover {
filter: brightness(0.9);
}

#paypalButton:hover {
filter: brightness(0.9);
}
/* Be a patron button */
#bePatronButton {
background-color: var(--paper-grey-100);
display: flex;
justify-content: center;
padding-bottom: 3px;
}

#bePatronButton a {
align-items: center;
background-color: rgb(255, 66, 77);
border-radius: 9999px;
border: 1px solid rgb(255, 66, 77);
box-sizing: border-box;
cursor: pointer;
display: inline-flex;
font-weight: 500;
justify-content: center;
padding: 7px 17px;
position: relative;
text-align: center;
text-decoration: none;
color: rgb(255, 255, 255) !important;
}

#bePatronButton a:hover {
background-color: #ff303c;
}

#bePatronButton .svgWrapper {
height: 14px;
width: 14px;
margin-right: 6px;
}

#bePatronButton svg {
fill: white;
}
80 changes: 80 additions & 0 deletions source/pages/donation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="optionsPageStyle.css" />
<link rel="stylesheet" href="donation.css" />
</head>

<body id="ContactTitle">
<div id="container">
<div id="header">
<div id="logo">
<img src="../img/logo/full_logo.svg" alt="Logo" />
</div>
<div id="menuContainer">
<a href="about.html" class="menuLinks" data-i18n="about"></a>
<a href="options.html" class="menuLinks" data-i18n="options"></a>
<a href="contact.html" class="menuLinks" data-i18n="contact"></a>
<a href="donation.html" class="menuLinks"><span id="donation_menu_link" data-i18n="donation"></span></a>
</div>
</div>
<div id="bodyContainer">
<div id="title" data-i18n="contact">Donation</div>
<div class="pageBody">
<div class="text">
<p>Thank you for using <strong>Music Mode for YouTube™</strong>!</p>
<p>
Developing and maintaining this extension takes time and effort. If you find it helpful,
<strong>please consider supporting us with a donation</strong>. Every contribution helps keep the project
going.
</p>
<p>Thank you for your support!</p>

<div id="payment_methods_container">
<div id="buymeacoffeeButton">
<a href="https://www.buymeacoffee.com/thunderarea" target="_blank"
><img
src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png"
alt="Buy Me A Coffee"
style="width: 150px !important"
/></a>
</div>
or
<div id="bePatronButton">
<a class="links" href="https://www.patreon.com/bePatron?u=67620554" target="_blank">
<div class="svgWrapper">
<span class="sc-iqHYGH hKKQNb">
<svg viewBox="0 0 569 546" xmlns="http://www.w3.org/2000/svg">
<g>
<circle cx="362.589996" cy="204.589996" data-fill="1" id="Oval" r="204.589996"></circle>
<rect data-fill="2" height="545.799988" id="Rectangle" width="100" x="0" y="0"></rect>
</g>
</svg>
</span>
</div>
<span data-i18n="beAPatronButton">Become a Patron!</span>
</a>
</div>
or
<form id="paypalButton" action="https://www.paypal.com/donate" method="post" target="_blank">
<input type="hidden" name="hosted_button_id" value="V2EHRNX8RBTX2" />
<input
type="image"
src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
border="0"
name="submit"
title="PayPal - The safer, easier way to pay online!"
alt="Donate with PayPal button"
/>
<img alt="" border="0" src="https://www.paypal.com/en_GR/i/scr/pixel.gif" width="1" height="1" />
</form>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="setTheTitles.js"></script>
</body>
</html>
Loading

0 comments on commit ab43f0f

Please sign in to comment.