Skip to content

Commit

Permalink
revision
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Sep 12, 2023
1 parent fe43c30 commit 97f6d19
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
2 changes: 2 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ chrome.storage.local.get('limit_page_width', function (result) {
else if(installed.reason == 'install'){
if(navigator.userAgent.indexOf("Firefox") != -1){chrome.storage.local.set({below_player_pip: false})};
if(navigator.userAgent.indexOf("Safari") != -1){chrome.storage.local.set({below_player_pip: false})};

// still needed? (are screenshots broken in Safari?):
if(navigator.userAgent.indexOf("Safari") != -1){chrome.storage.local.set({below_player_screenshot: false})};
// console.log('Thanks for installing!');
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ html[it-related-videos='Titles'] #related #dismissible #metadata { margin-top:-3
html[it-related-videos='hidden'] #related #contents,
html[it-related-videos='hidden'] #related #dismissible,
html[it-related-videos='hidden'] #related > ytd-watch-next-secondary-results-renderer > #items,
html[it-related-videos='hidden'] ytd-item-section-renderer,
html[it-related-videos='hidden'] ytd-compact-video-renderer
html[data-page-type=video][it-related-videos='hidden'] ytd-compact-video-renderer
{display: none !important}

html[it-related-videos='hidetabs'] #related #chips
html[data-page-type=video][it-related-videos='hidetabs'] #related #chips
{display: none !important}

html[it-hide-sidebar='true'] #related > ytd-watch-next-secondary-results-renderer > #items,
Expand Down Expand Up @@ -185,8 +184,6 @@ html[data-page-type=video][it-no-page-margin='true'] ytd-browse > ytd-two-column
html[data-page-type=video][it-sidebar-left='true'] #columns>#primary,
html[data-page-type=video][it-sidebar-left='true'] #head>#upnext{
order: 5 !important;}

html[data-page-type=video][it-sidebar-left='true'][it-comments-sidebar='true'] #comments{order: 6 !important;}

html[data-page-type=video][it-sidebar-left='true'] #columns>#secondary>#related {margin-left: calc(0.5vw + 4px); margin-right:1vw !important;}

Expand Down
6 changes: 3 additions & 3 deletions js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ ImprovedTube.ytElementsHandler = function (node) {
ImprovedTube.elements.player_thumbnail = node.querySelector('.ytp-cued-thumbnail-overlay-image');
ImprovedTube.elements.player_subtitles_button = node.querySelector('.ytp-subtitles-button');
ImprovedTube.playerSize();

// if ( typeof this.storage.ads !== 'undefined' && this.storage.ads !== "all_videos" ) {
new MutationObserver(function (mutationList) {
for (var i = 0, l = mutationList.length; i < l; i++) {
var mutation = mutationList[i];
Expand All @@ -184,10 +184,10 @@ ImprovedTube.ytElementsHandler = function (node) {
}
}).observe(node, {
attributes: false,
// attributes: true,
// attributes: true,
childList: true,
subtree: true
});
}); // }

new MutationObserver(function (mutationList) {
for (var i = 0, l = mutationList.length; i < l; i++) {
Expand Down
10 changes: 5 additions & 5 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,18 @@ ADS
ImprovedTube.playerAds = function (parent) {
let button = parent.querySelector('.ytp-ad-skip-button.ytp-button') || parent;
// TODO: Replace this with centralized video element pointer
// let video = document.querySelector('.video-stream.html5-main-video');
let video = document.querySelector('.video-stream.html5-main-video') || false;
function skipAd() {
//if (video) video.currentTime = video.duration;
if (video) video.currentTime = video.duration;
if (button) button.click();
}
if (this.storage.player_ads === 'block_all') {
if (this.storage.ads === 'block_all') {
skipAd();
} else if (this.storage.player_ads === 'subscribed_channels') {
} else if (this.storage.ads === 'subscribed_channels') {
if (!parent.querySelector('#meta paper-button[subscribed]')) {
skipAd();
}
} else if (this.storage.player_ads === 'block_music') {
} else if (this.storage.ads === 'block_music') {
if (ImprovedTube.elements.category === 'music') {
skipAd();
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"short_name" : "ImprovedTube",
"name": "'Improve YouTube!' 🎧 (for YouTube & Videos)",
"description": "__MSG_description_ext__",
"version": "4.337",
"version": "4.339",
"default_locale": "en",
"icons": {
"16": "stuff/icons/16.png",
Expand Down
4 changes: 0 additions & 4 deletions menu/skeleton-parts/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,6 @@ extension.skeleton.main.layers.section.appearance.on.click.sidebar = {
hide_sidebar: {
component: "switch",
text: "Hide sidebar"
},
hide_tags: {
component: "switch",
text: "Hide tags"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion menu/skeleton-parts/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ extension.skeleton.main.layers.section.general = {
}, {
text: 'onSubscribedChannels',
value: 'subscribed_channels'
}]
}], storage: 'ads'
},
youtube_home_page: {
component: 'select',
Expand Down

0 comments on commit 97f6d19

Please sign in to comment.