Soap2Day Autoplay

Soap2Day - Autoplay shows and movies in fullscreen mode when page loads.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           Soap2Day Autoplay
// @version        0.1
// @description    Soap2Day - Autoplay shows and movies in fullscreen mode when page loads.
// @author         mohitdhule
// @include        https://soap2day.to/*
// @include        https://soap2day.im/*
// @include        https://soap2day.ac/*
// @include        https://soap2day.se/*
// @include        https://s2dfree.to/*
// @include        https://s2dfree.cc/*
// @include        https://s2dfree.de/*
// @include        https://s2dfree.is/*
// @include        https://s2dfree.in/*
// @include        https://s2dfree.nl/*
// @include        https://secretlink.xyz/*
// @run-at         document-idle
// @namespace https://greasyfork.org/users/776541
// ==/UserScript==

(function() {
    'use strict';
    function rafAsync() {
        return new Promise(resolve => requestAnimationFrame(resolve));
    }
    async function checkElement(selector) {
        let querySelector = null;
        while (querySelector === null) {
            await rafAsync();
            querySelector = document.querySelector(selector);
        }
        return querySelector;
    }
    checkElement('video').then(element => {
        const newScript = document.createElement("script");
        const inlineScript = document.createTextNode("jwplayer().play();jwplayer().setFullscreen(true);");
        newScript.appendChild(inlineScript);
        const target = document.body;
        target.appendChild(newScript);
    });
})();