shawenguan 2 년 전
부모
커밋
f728631973
1개의 변경된 파일18개의 추가작업 그리고 18개의 파일을 삭제
  1. 18 18
      Scripts/tglinks/tglinks.js

+ 18 - 18
Scripts/tglinks/tglinks.js

@@ -7,26 +7,26 @@ let html = $response.body || '';
 let regex = /<a class="tgme_action_button_new shine" href="([\S]+)">([^<]+)<\/a>/;
 
 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);
-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 = `<a class="tgme_action_button_new shine" href="${newHref}">${newText}</a>`;
-    let newHtmlStr = html.replace(regex, matches[0]+'\n'+replacement);
+// 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);
+// 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 = `<a class="tgme_action_button_new shine" href="${newHref}">${newText}</a>`;
+//     let newHtmlStr = html.replace(regex, matches[0]+'\n'+replacement);
 
-    let regex2 = /var\s*protoUrl\s*=\s*"([^"]+)"/;
-    newHtmlStr = newHtmlStr.replace(regex, 'var protoUrl=null');
+//     let regex2 = /var\s*protoUrl\s*=\s*"([^"]+)"/;
+//     newHtmlStr = newHtmlStr.replace(regex, 'var protoUrl=null');
 
-    newHtmlStr = newHtmlStr.replace('if\s*\(true\)\s*\{', 'if (false) {');
-    html = newHtmlStr;
-}
+//     newHtmlStr = newHtmlStr.replace('if\s*\(true\)\s*\{', 'if (false) {');
+//     html = newHtmlStr;
+// }
 $.done({
   body: html
 });