diff --git a/background.js b/background.js index fd3ea17f3..5d9fc4fa6 100644 --- a/background.js +++ b/background.js @@ -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!'); }; diff --git a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css index 2f43f62a3..984f69f60 100644 --- a/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css +++ b/js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css @@ -98,11 +98,11 @@ 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-item-section-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, diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 87033c868..34f77b252 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -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]; @@ -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++) { diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 8d4ee2126..bf799d330 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -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(); } diff --git a/manifest.json b/manifest.json index 83a99fcd1..62b103d62 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "short_name" : "ImprovedTube", "name": "'Improve YouTube!' 🎧 (for YouTube & Videos)", "description": "__MSG_description_ext__", - "version": "4.337", + "version": "4.338", "default_locale": "en", "icons": { "16": "stuff/icons/16.png", diff --git a/menu/skeleton-parts/appearance.js b/menu/skeleton-parts/appearance.js index 0d8de4cbd..5756c2ebd 100644 --- a/menu/skeleton-parts/appearance.js +++ b/menu/skeleton-parts/appearance.js @@ -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" } } } diff --git a/menu/skeleton-parts/general.js b/menu/skeleton-parts/general.js index e02fc7790..5e13b19c6 100644 --- a/menu/skeleton-parts/general.js +++ b/menu/skeleton-parts/general.js @@ -1054,7 +1054,7 @@ extension.skeleton.main.layers.section.general = { }, { text: 'onSubscribedChannels', value: 'subscribed_channels' - }] + }], storage: 'ads' }, youtube_home_page: { component: 'select',