double-touched to enter fullscreen

I AM THE WORLD

目前為 2025-03-20 提交的版本,檢視 最新版本

// ==UserScript==
// @name         double-touched to enter fullscreen
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  I AM THE WORLD
// @author       You
// @match        *://*.douyin.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=douyin.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    window.cnt = 0;
    document.getElementById('douyin-right-container').addEventListener('touchend',()=>{

        if(window.cnt === 0) {
            window.cnt += 1;window.lastTime = Date.now();
        }else if(window.cnt === 1 && Date.now() - window.lastTime <= 300) {
            document.documentElement.webkitRequestFullscreen();
            window.cnt = 0;
        }else {
            window.cnt = 0;
        }


    })
    // Your code here...
})();