long touch to fullscreen

long touch to fullscreenfor for mobile

目前为 2022-02-08 提交的版本。查看 最新版本

// ==UserScript==
// @name         long touch to fullscreen
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  long touch to fullscreenfor for mobile
// @author       amormaid
// @run-at       document-end
// @match        http(s)?://*/*
// @include      http://*
// @include      https://*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    // document.documentElement.requestFullscreen()
    let time_list = []


    document.body.addEventListener('touchend', function () {
        console.log('touch end')
        startTime = +new Date()
        time_list = [time_list.slice(-2) , starttime]
        const [a, b, c] = time_list
        if (a && c && c - a < 1500) {
            console.log('long touch', endTime)
            // 处理点击事件
            document.documentElement.requestFullscreen()
        }
    })

})();

QingJ © 2025

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