long touch to fullscreenfor for mobile
当前为
// ==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()
}
})
})();