diff --git a/js&css/web-accessible/www.youtube.com/settings.js b/js&css/web-accessible/www.youtube.com/settings.js index 06b00d4e6..f282f301f 100644 --- a/js&css/web-accessible/www.youtube.com/settings.js +++ b/js&css/web-accessible/www.youtube.com/settings.js @@ -173,10 +173,13 @@ ImprovedTube.youtubeLanguage = function () { let value = this.storage.youtube_language; if (value) { - if (value !== 'default') { - this.setPrefCookieValueByName('hl', value); - } else { + if (value == 'disabled') { + // do nothing + } else if (value == 'default') { + // Delete 'hl' PREF cookie, let YT pick default Browser language this.setPrefCookieValueByName('hl', null); + } else { + this.setPrefCookieValueByName('hl', value); } } }; diff --git a/menu/skeleton-parts/settings.js b/menu/skeleton-parts/settings.js index 6d440d858..d436e6612 100644 --- a/menu/skeleton-parts/settings.js +++ b/menu/skeleton-parts/settings.js @@ -334,7 +334,14 @@ extension.skeleton.header.sectionEnd.menu.on.click.settings.on.click.secondSecti text: 'youtubeLanguage', storage: 'youtube_language', options: function () { - return extension.skeleton.header.sectionEnd.menu.on.click.settings.on.click.secondSection.language.on.click.section.languages; + return [{value: 'disabled', text: "Disabled"}].concat(extension.skeleton.header.sectionEnd.menu.on.click.settings.on.click.secondSection.language.on.click.section.languages); + }, + on: { + change: function (event) { + if (event.target.value === 'disabled') { + satus.storage.remove('youtube_language'); + } + } } } }