Always Open Telegram Link with tp Protocol

convert the URL from "http://t.me" or "http://telegram.me" to "tp://"

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Always Open Telegram Link with tp Protocol
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  convert the URL from "http://t.me" or "http://telegram.me" to "tp://"
// @author       Lee
// @match        https://*/*
// @grant        none
// ==/UserScript==

(function(){
for(var i=0;i<document.links.length;i++){
    var anchor=document.links[i];
    if(anchor.href.match(/^\S*:\/\/t.me\//) || anchor.href.match(/^\S*:\/\/telegram.me\//)){
        var temp = anchor.href.replace(/^\S*.me\//, 'tg://resolve?domain=');
        document.links[i].href = temp;
        var method = "_self";
        document.links[i].target = method;
    }
}
})();