Soap2Day Autoplay

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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/*
// @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);
    });
})();