shawenguan há 2 anos atrás
pai
commit
eea513a936

Diff do ficheiro suprimidas por serem muito extensas
+ 31 - 0
Scripts/tglinks/TgLinksHelper.js


+ 0 - 32
Scripts/tglinks/tglinks.js

@@ -1,32 +0,0 @@
-
-
-if(!$response){
-    return
-}
-let html = $response.body || '';
-console.log("###tglinks###");
-let regex = /<div class="tgme_page_action">\s*<a class="tgme_action_button_new shine" href="([\S]+)">([^<]+)<\/a>\s*<\/div>/;
-let matches = html.match(regex);
-console.log(JSON.stringify(matches));
-
-if (matches) {
-    let allContent = matches[0];
-    let originalHref = matches[1];
-    let originalText = matches[2];
-    console.log(originalHref);
-    console.log(originalText);
-    // 定义新的href和链接文本
-    let newHref = originalHref.replace('tg://', 'ncg://');
-    let newText = 'View on Nicegram';
-    let replacement = `<div class="tgme_page_action"><a class="tgme_action_button_new shine" href="${newHref}">${newText}</a></div>`;
-    let newHtmlStr = html.replace(allContent, allContent+'\n'+replacement);
-
-    let regex2 = /var\s*protoUrl\s*=\s*"([\S]+)"/;
-    newHtmlStr = newHtmlStr.replace(regex2, 'var protoUrl=null');
-
-    newHtmlStr = newHtmlStr.replace('if\s*\(true\)\s*\{', 'if (false) {');
-    html = newHtmlStr;
-}
-$done({
-  body: html
-});

+ 1 - 1
Scripts/tglinks/tglinks.rewirte.quanx.conf

@@ -1,3 +1,3 @@
 hostname = t.me
 
-^https:\/\/t.me url script-response-body https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/tglinks/tglinks.js
+^https:\/\/t.me url script-response-body https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/tglinks/TgLinksHelper.js

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff