From 2212f510b98a1a4e46270fece218fca9f4a0f01d Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Tue, 7 Nov 2023 01:37:56 +0100 Subject: [PATCH] #1809 --- js&css/extension/core.js | 16 +++++++++++++++- js&css/web-accessible/www.youtube.com/player.js | 5 ++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/js&css/extension/core.js b/js&css/extension/core.js index e3aa4f87a..44862ecc3 100644 --- a/js&css/extension/core.js +++ b/js&css/extension/core.js @@ -322,4 +322,18 @@ extension.storage.load = function (callback) { callback(extension.storage.data); } }); -}; \ No newline at end of file +}; + +/*-------------------------------------------------------------- +# Experimental remedy for many uninstalls since October 18, for no apparent reason (unrelated to us) +from @dodieboy's UO rules https://github.com/code-charity/youtube/issues/1809#issuecomment-1783983060 +--------------------------------------------------------------*/ + +window.addEventListener('load', function () { + if (window.location.hostname === 'www.youtube.com') { + yt.config_.openPopupConfig.supportedPopups.adBlockMessageViewModel = false; + Object.prototype.adBlocksFound = 0; + ytplayer.config.args.raw_player_response.adPlacements = []; + Object.prototype.hasAllowedInstreamAd = true; + } +}); \ No newline at end of file diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 8c76b68e9..af3aaf5e6 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -89,9 +89,8 @@ ImprovedTube.playerPlaybackSpeed = function () { var musicIdentifiersTagsOnly = /, (lyrics|remix|song|music|AMV|theme song|full song),/i; var musicIdentifiersTags = new RegExp(musicIdentifiersTagsOnly.source + musicIdentifiers.source, "i"); var keywordsAmount = 1 + ((keywords || '').match(/,/) || []).length; - if ( ((keywords || '').match(musicIdentifiersTags) || []).length / keywordsAmount > 0.08 { - musicRegexMatch = true) - } + if ( ((keywords || '').match(musicIdentifiersTags) || []).length / keywordsAmount > 0.08) { + musicRegexMatch = true} } let notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(title + " " + keywords); // (Tags/keywords shouldnt lie & very few songs titles might have these words)