Skip to content

Commit

Permalink
Fixed "Player" -> "Up next autoplay"
Browse files Browse the repository at this point in the history
  • Loading branch information
adokseo committed Mar 5, 2021
1 parent 4d3f2cb commit 67de39e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Improve YouTube! (Open-Source for YouTube)",
"short_name": "ImprovedTube",
"description": "Make YouTube tidy & powerful! YouTube Player Size Theme Quality Auto HD Colors Playback Speed Style ad block Playlist Channel H.264",
"version": "3.175",
"version": "3.177",
"default_locale": "en",
"icons": {
"128": "assets/icons/128.png",
Expand Down
5 changes: 3 additions & 2 deletions youtube-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1106,12 +1106,13 @@ ImprovedTube.upNextAutoplay = function() {
var option = this.storage.up_next_autoplay;

if (this.isset(option)) {
var toggle = document.querySelector('#related #head.ytd-compact-autoplay-renderer #toggle');
var toggle = document.querySelector('.ytp-right-controls .ytp-autonav-toggle-button'),
attribute = toggle.getAttribute('aria-checked');

if (toggle) {
var option = ImprovedTube.storage.up_next_autoplay;

if (option === true && !toggle.hasAttribute('checked') || option === false && toggle.hasAttribute('checked')) {
if (option === true && attribute === 'false' || option === false && attribute === 'true') {
toggle.click();
}
}
Expand Down

0 comments on commit 67de39e

Please sign in to comment.