Greasy Fork is available in English.

TikTok to TikWM Redirect

Redirect TikTok video links to tikwm.com in a new tab when middle-clicked

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
作者
femto
1日のインストール数
0
累計インストール数
30
評価
0 0 0
バージョン
0.6
作成日
2024/06/02
更新日
2024/06/02
ライセンス
不明
対象サイト

Script Name: TikTok to TikWM Redirect

Description:
Redirects TikTok video links to tikwm.com in a new tab when middle-clicked.
Works on both TikTok's website and Discord's chat platform.

Features:
Middle-click TikTok video links to open them on tikwm.com in a new tab.
Supports two URL formats:
Direct TikTok video links (e.g., https://www.tiktok.com/@username/video/1234567890)
Discord's URL pattern for TikTok videos (e.g., https://www.tiktok.com/username/video/1234567890)

How it Works:
Listens for middle clicks on elements.
Checks if clicked element is a link ( tag) with a matching TikTok URL pattern.
Extracts video ID from the URL using regular expressions (if it's a TikTok link).
Constructs the corresponding tikwm.com URL using the extracted video ID.
Opens the constructed tikwm.com URL in a new tab using GM_openInTab (Tampermonkey-specific).
Prevents the default middle-click behavior.

Additional Notes:
Relies on GM_openInTab, which might not work with all userscript managers.