Greasy Fork is available in English.

acfun关闭自动播放

acfun turn off autoplay

// ==UserScript==
// @name         acfun关闭自动播放
// @namespace    荧之风
// @version      0.23
// @description  acfun turn off autoplay
// @author       荧之风
// @match        *.acfun.cn/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

     window.onload = function () {
//sleep
         function sleep (time) {
             return new Promise((resolve) => setTimeout(resolve, time));
         }
// sleep 1s for loading
         sleep(500).then(() => {
//pause
         try{
       let pb = document.querySelector('.btn-play');
         //debugger;
         if (pb.querySelector('.btn-span').getAttribute('data-bind-attr')=='play')
             pb.click()
         }catch(err){ console.log(err);}
             })
          sleep(500).then(() => {
//autoplay
         try{
         let setting = document.querySelectorAll('.control-checkbox')
         let ap=setting[1];
         if(ap.getAttribute('data-bind-attr')=='true')
             //ap.setAttribute('data-bind-attr','false');
             ap.click()
         //console.log('AP:', ap.getAttribute('data-bind-attr'))
         }catch(err){ console.log(err);}
         })
    };
})();