long touch to fullscreen

triple touch to fullscreen for for mobile

  1. // ==UserScript==
  2. // @name long touch to fullscreen
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.3
  5. // @description triple touch to fullscreen for for mobile
  6. // @author amormaid
  7. // @run-at document-end
  8. // @match http(s)?://*/*
  9. // @include http://*
  10. // @include https://*
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  12. // @grant none
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18. // document.documentElement.requestFullscreen()
  19. let time_list = []
  20. function fullscreen() {
  21. console.log('touch end')
  22. time_list = [...time_list.slice(-2) , +new Date()]
  23. const [a, b, c] = time_list
  24. if (a && c && c - a < 1500) {
  25. // 处理点击事件
  26. document.documentElement.requestFullscreen()
  27. }
  28. }
  29.  
  30. document.body.addEventListener('touchend', fullscreen )
  31.  
  32. })();

QingJ © 2025

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