Greasy Fork镜像 支持简体中文。

YGestures

for Android Browser without Touch Gestures(particularly Yandex)【向手机版yandex浏览器注入前进&后退手势&&网页文本粘贴功能,并可临时禁用某一手势】

目前為 2019-11-22 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name YGestures
  3. // @namespace http://monodog.net/
  4. // @version 0.5.8
  5. // @license CC-BY-NC-SA-4.0
  6. // @description for Android Browser without Touch Gestures(particularly Yandex)【向手机版yandex浏览器注入前进&后退手势&&网页文本粘贴功能,并可临时禁用某一手势】
  7. // @author Monodog Theiions
  8. // @icon https://monodog.neocities.org/js/icon/YGestures.png
  9. // @homepage https://gf.qytechs.cn/zh-CN/scripts/392713-ygestures
  10. // @supportURL mailto:wung.thy@gmail.com
  11. // @match http://*/*
  12. // @include https://*/*
  13. // @exclude *://*login*
  14. // @run-at document-body
  15. // @require https://cdn.jsdelivr.net/npm/hammerjs@2.0.8
  16. // @grant unsafeWindow
  17. // @contributionURL https://qr.alipay.com/fkx02998fhy75rwy0pjx2eb
  18. // @compatible Yandex for Android , etc
  19. // @incompatible All Browser without Touch
  20. // ==/UserScript==
  21.  
  22. (function() {
  23. 'use strict';
  24. if(window.navigator.userAgent.toLowerCase().indexOf("linux")>10)// code here
  25. {
  26. let YGBool=0;
  27. let copyStr="";
  28. let array=["上隐藏*下显示*左前进*右后退,按住禁用滑动事件","右滑已经禁用,按住继续更改","水平滑动已经禁用,按住继续更改","上下功能已对调,左右滑动已禁用,按住还原"];
  29. let body=document.getElementsByTagName("body")[0];
  30. var floatDIV = document.createElement("div");
  31. floatDIV.style.cssText=
  32. "width:100%; height:30px; background:SlateBlue;color:Ivory;line-height:30px;display:none;position: fixed;bottom: 0;font-size:12px";
  33. floatDIV.innerHTML=array[0];
  34. body.appendChild(floatDIV);
  35. let footArea = document.createElement("textarea");
  36. footArea.rows="9";footArea.style.cssText=
  37. "width:60%;border:solid 1px #f00; background:Ivory;color:SlateBlue;display:none;position: fixed;bottom: 0;font-size:12px";
  38. body.appendChild(footArea);
  39. new Hammer(body).on("pan", function (e) {
  40. let _e = event || window.event;
  41. if(Math.abs(e.deltaY) < 2 * Math.abs(e.deltaX) + 2 ) {
  42. var e = event || window.event;
  43. copyStr=(document.elementFromPoint(e.clientX, e.clientY).innerHTML);
  44. floatDIV.style.display="block";
  45. if(footArea.style.display=="none")floatDIV.innerHTML=array[YGBool]+"#@向上拖拽启动粘贴";
  46. copyStr=copyStr.replace(/<[^>]*>/g, '\r\n');footArea.value=copyStr;
  47. alert(copyStr);
  48. }
  49. else if((e.deltaY<0)!=(YGBool==3)) floatDIV.style.display=footArea.style.display;
  50. else floatDIV.style.display= "block";})
  51. .on("swipeleft", function (e) {
  52. if(Math.abs(e.deltaX) > 2 * Math.abs(e.deltaY) + 2 && YGBool<2 ) window.history.go(1);})
  53. .on("swiperight", function (e) {
  54. if(Math.abs(e.deltaX) > 2 * Math.abs(e.deltaY) + 2 && YGBool==0 ) window.history.go(-1);})
  55. .on("pressup", function (_e) { var e = event || window.event;
  56. copyStr=(document.elementFromPoint(e.clientX, e.clientY).innerHTML);
  57. floatDIV.style.display="block";
  58. if(footArea.style.display=="none")floatDIV.innerHTML=array[YGBool]+"#@向上拖拽启动粘贴";
  59. copyStr=copyStr.replace(/<[^>]*>/g, '\r\n');footArea.value=copyStr;})
  60. new Hammer(floatDIV).on("pressup", function (e) {
  61. if(footArea.style.display=="block");
  62. else if(copyStr=="") floatDIV.innerHTML=array[YGBool=(YGBool+1)&3];
  63. else floatDIV.innerHTML=array[YGBool=(YGBool+1)&3]+"#@向上拖拽启动粘贴";})
  64. .on("pan", function (e) {
  65. if(-(e.deltaY) > 2 * Math.abs(e.deltaX) + 2 && copyStr!="") {
  66. footArea.style.display="block";YGBool=3;footArea.value=copyStr;
  67. let sq="左滑收起,左滑转上滑安全收起;"
  68. floatDIV.innerHTML=sq+sq+sq+sq+sq+sq+sq+sq+sq+sq+sq+sq+sq;
  69. }
  70. if(-(e.deltaX) > 2 * Math.abs(e.deltaY) + 2 ) {
  71. footArea.style.display="none";YGBool=0;copyStr="";floatDIV.innerHTML=array[YGBool];}
  72. })
  73.  
  74. }
  75. })();

QingJ © 2025

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