2 in 1

Removes attributes and lets PiP run when you press `alt+ctrl+p`

目前為 2023-09-14 提交的版本,檢視 最新版本

// ==UserScript==
// @name         2 in 1
// @version      2.0
// @description  Removes attributes and lets PiP run when you press `alt+ctrl+p`
// @author       Edward D
// @include      http://*
// @include      https://*
// @namespace    https://edwarddk.github.io/EdwardD-Portfolio/
// ==/UserScript==


//FOR THE PIP PRESS ALT + CTRL + P

(function() {
    'use strict';

    window.addEventListener("play", function(e) {
    e.target.removeAttribute("disablePictureInPicture")
}, true)

window.addEventListener("pause", function(e) {
    e.target.removeAttribute("disablePictureInPicture")
}, true)

    console.log('RUNNING');
    document.body.addEventListener('keyup', function(e){
        if(e.altKey && e.ctrlKey && e.key === 'p') {
            var video = document.querySelector('video');
            video.requestPictureInPicture();
        }
    })
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址