Greasy Fork is available in English.

Let Me Multitask, Bro

A Tampermonkey script that allows picture-in-picture mode to be used for videos, even if the website has disabled it.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Let Me Multitask, Bro
// @author       Christopher Conley
// @copyright    Copyright (C) 2023 Christopher Conley
// @license      GPL-2.0-only
// @version      0.2.1
// @description  A Tampermonkey script that allows picture-in-picture mode to be used for videos, even if the website has disabled it.
// @namespace    https://github.com/rosettast0ned/let-me-multitask-bro
// @source       https://github.com/rosettast0ned/let-me-multitask-bro
// @supportURL   https://github.com/rosettast0ned/let-me-multitask-bro/issues
// @match        *://*/*
// @icon         https://raw.githubusercontent.com/rosettast0ned/let-me-multitask-bro/main/tampermonkey/let_me_multitask_bro.png
// @icon64       https://raw.githubusercontent.com/rosettast0ned/let-me-multitask-bro/main/tampermonkey/let_me_multitask_bro64.png
// @run-at       document-idle
// ==/UserScript==
//
// Picture in picture icon by Ria Fitriana from https://thenounproject.com/browse/icons/term/picture-in-picture/ Noun Project (CC BY 3.0)
//

(function () {
    console.log('LMMB: Let Me Multitask, Bro extension triggered.')

    var poller = setInterval(function () {
        if (document.querySelector('video') !== null) {
            clearInterval(poller);
            console.log("LMMB: Found video element.");

            var videos = document.querySelectorAll('video');

            videos.forEach(video => {
                if (video.hasAttribute('disablepictureinpicture')) {
                    console.log('LMMB: Removing disablepictureinpicture attribute from video element.');
                    video.removeAttribute('disablepictureinpicture');
                }
            });
        }
    }, 50);

})();