通用视频背景播放

让视频在后台也能继续播放,兼容大多数主流视频网站

// ==UserScript==
// @name         通用视频背景播放
// @namespace    MilesTurner
// @version      1.0.0
// @description  让视频在后台也能继续播放,兼容大多数主流视频网站
// @author       Miles Turner
// @match        *://*/*
// @icon         https://www.greasyfork.org/static/icon256.png
// @license      MIT
// @homepageURL  https://greasyfork.org/zh-CN/scripts/000000
// @supportURL   https://greasyfork.org/zh-CN/scripts/000000/feedback
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    Object.defineProperty(document, 'hidden', {
        get: function() { return false; },
        configurable: true
    });
    Object.defineProperty(document, 'visibilityState', {
        get: function() { return 'visible'; },
        configurable: true
    });
})();