|
| 1 | +{ |
| 2 | + "facts": [{ |
| 3 | + "@type": "type.googleapis.com/ClipboardContentChanged", |
| 4 | + "content": "(?:(?:https?:\\/\\/)|(?:www\\.))[-a-zA-Z0-9@:%._\\+~#\u003d]{1,256}\\.[a-z]{2,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?\u0026//\u003d]*)", |
| 5 | + "matchOptions": "RegexMatchOptions_ContainsMatchIn", |
| 6 | + "customContextDataKey": { |
| 7 | + }, |
| 8 | + "id": "F-002c9a3e-d0d8-433b-9906-d7efd69a01ce" |
| 9 | + }], |
| 10 | + "conditions": [{ |
| 11 | + "@type": "type.googleapis.com/CurrentPkgList", |
| 12 | + "pkgs": [{ |
| 13 | + "pkgName": "com.tencent.mobileqq" |
| 14 | + }, { |
| 15 | + "pkgName": "com.tencent.mm" |
| 16 | + }], |
| 17 | + "op": "ANY", |
| 18 | + "customContextDataKey": { |
| 19 | + }, |
| 20 | + "id": "C-6c5e3887-3918-4977-8880-e30fbf1694c3" |
| 21 | + }, { |
| 22 | + "@type": "type.googleapis.com/MatchJS", |
| 23 | + "expression": "(%CurrentTimeMillis% - globalVarOf$QVhelper_pausedDate) \u003e\u003d 600000", |
| 24 | + "customContextDataKey": { |
| 25 | + }, |
| 26 | + "id": "C-20691274-7750-4af2-81e0-6ce2befcf498" |
| 27 | + }], |
| 28 | + "actions": [{ |
| 29 | + "@type": "type.googleapis.com/ExecuteJS", |
| 30 | + "expression": "// 1. 获取输入内容\nvar inputContent \u003d \u0027{clipboardContent}\u0027;\n\n// 2. 定义增强版正则\n// 逻辑:必须以 \"http(s)://\" 或者 \"www.\" 开头,避免匹配到普通文件名或英文句号\nvar urlRegex \u003d /(?:(?:https?:\\/\\/)|(?:www\\.))[-a-zA-Z0-9@:%._\\+~#\u003d]{1,256}\\.[a-z]{2,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?\u0026//\u003d]*)/i;\n\n// 3. 执行匹配\nvar match \u003d inputContent.match(urlRegex);\n\n// 4. 处理结果\nif (match) {\n // 提取出的原始字符串\n var rawUrl \u003d match[0];\n \n // [严谨细节]:如果提取出的网址是以 \u0027www.\u0027 开头且没有协议头,通常需要补全 \u0027https://\u0027 \n // 才能被后续的网络请求或浏览器识别。如果你只想要纯文本,可以去掉下面这个 if 判断。\n if (!/^https?:\\/\\//i.test(rawUrl)) {\n localVarOf$tempCC \u003d \u0027https://\u0027 + rawUrl;\n } else {\n localVarOf$tempCC \u003d rawUrl;\n }\n} else {\n // 未匹配到则置空\n localVarOf$tempCC \u003d null; \n}\n\n// 5. 调试输出\nlocalVarOf$tempCC", |
| 31 | + "customContextDataKey": { |
| 32 | + }, |
| 33 | + "id": "A-23289266-23c9-455a-8efd-4b9ec3d854bc" |
| 34 | + }, { |
| 35 | + "@type": "type.googleapis.com/ShowAlertDialog", |
| 36 | + "positive": "走你", |
| 37 | + "onPositive": [{ |
| 38 | + "@type": "type.googleapis.com/StartActivityUrlSchema", |
| 39 | + "urlSchema": "{jsRet}", |
| 40 | + "customContextDataKey": { |
| 41 | + }, |
| 42 | + "id": "A-1ecb7c4b-a8f3-406d-9dd0-3b325a0fd8a7" |
| 43 | + }], |
| 44 | + "negative": "不要", |
| 45 | + "neutral": "暂停10min", |
| 46 | + "onNeutral": [{ |
| 47 | + "@type": "type.googleapis.com/WriteGlobalVar", |
| 48 | + "varName": "QVhelper_pausedDate", |
| 49 | + "valueAsString": "%CurrentTimeMillis%", |
| 50 | + "op": "WriteGlobalVarOp_Override", |
| 51 | + "customContextDataKey": { |
| 52 | + }, |
| 53 | + "id": "A-816a9482-eb6b-4b8f-8598-70a41fe12b46" |
| 54 | + }], |
| 55 | + "title": "跳转浏览器", |
| 56 | + "message": "检测到剪贴板含有网址,是否跳转到浏览器打开?", |
| 57 | + "cancelable": true, |
| 58 | + "style": { |
| 59 | + "fontScale": 1.0 |
| 60 | + }, |
| 61 | + "customContextDataKey": { |
| 62 | + }, |
| 63 | + "id": "A-fcc6399d-fab5-4879-908e-164f84475193" |
| 64 | + }], |
| 65 | + "id": "SHARE-rule-fb5a17aa-85ce-49de-81b3-71a30b1efe9d", |
| 66 | + "lastUpdateTime": "1764155034651", |
| 67 | + "createTime": "1709886071860", |
| 68 | + "author": { |
| 69 | + "name": "ShortX" |
| 70 | + }, |
| 71 | + "title": "Q微剪切板助手", |
| 72 | + "description": "当QQ微信中复制了链接,选择是否跳转浏览器\n❗注意链接必须以http或www开头才能被识别", |
| 73 | + "isEnabled": true, |
| 74 | + "hook": { |
| 75 | + "actionsOnEnabled": [{ |
| 76 | + "@type": "type.googleapis.com/CreateGlobalVar", |
| 77 | + "globalVar": { |
| 78 | + "name": "QVhelper_pausedDate", |
| 79 | + "type": { |
| 80 | + "@type": "type.googleapis.com/StringVar" |
| 81 | + }, |
| 82 | + "note": "暂停跳转" |
| 83 | + }, |
| 84 | + "customContextDataKey": { |
| 85 | + }, |
| 86 | + "id": "A-8e8b3e0a-d084-45a3-bf4c-bab5fb777794" |
| 87 | + }, { |
| 88 | + "@type": "type.googleapis.com/WriteGlobalVar", |
| 89 | + "varName": "QVhelper_pausedDate", |
| 90 | + "valueAsString": "1145141919810", |
| 91 | + "customContextDataKey": { |
| 92 | + }, |
| 93 | + "id": "A-be69d4ee-80fd-4374-8b7f-3b7bdf094d9d" |
| 94 | + }], |
| 95 | + "actionsOnDeleted": [{ |
| 96 | + "@type": "type.googleapis.com/DeleteGlobalVar", |
| 97 | + "varName": "QVhelper_pausedDate", |
| 98 | + "customContextDataKey": { |
| 99 | + }, |
| 100 | + "id": "A-146e622b-d3f8-41a6-9a71-9893d2096a03" |
| 101 | + }] |
| 102 | + }, |
| 103 | + "quit": { |
| 104 | + }, |
| 105 | + "versionCode": "1", |
| 106 | + "ruleSetId": "RS-ced961d7-7ce0-46c8-aa8f-31cfd495f5e8" |
| 107 | +} |
| 108 | +###------### |
| 109 | +{"type":"rule"} |
0 commit comments