Skip to content

Commit

Permalink
C: make ext. fire-and-forget
Browse files Browse the repository at this point in the history
Reverse code to make autoplay turn off on installation
  • Loading branch information
JohnyP36 authored Nov 4, 2023
1 parent daef1ec commit d1e8aec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manifest_v2/js/autoplay+loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let YTNonstop = function YTNonstop(options) {
}
//if video ended ---> skip to next video
const AutoPlay = () => {
if(Nonstop.getIsAutoSkip() == true && get_YT.player().getPlayerState() === 0) {
if(Nonstop.getIsAutoSkip() == false && get_YT.player().getPlayerState() === 0) {
get_YT.player().setAutonav(true);

const Index = get_YT.player().getPlaylistIndex();
Expand Down Expand Up @@ -176,11 +176,11 @@ let YTNonstop = function YTNonstop(options) {
const off = document.querySelector('.ytp-autonav-toggle-button-container > .ytp-autonav-toggle-button[aria-checked="false"]')
|| document.querySelector('#automix[role="button"][aria-pressed="false"]')

if (Nonstop.getIsAutoSkip() == true && off) {
if (Nonstop.getIsAutoSkip() == false && off) {
off.click();
log('Autoplay has been enabled');
} else
if (Nonstop.getIsAutoSkip() == false && on) {
if (Nonstop.getIsAutoSkip() == true && on) {
on.click();
log('Autoplay has been disabled');
} else {
Expand Down

0 comments on commit d1e8aec

Please sign in to comment.