Greasy Fork is available in English.

TikTok to TikWM Redirect

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

Yazar
femto
Günlük kurulumlar
0
Toplam kurulumlar
40
Değerlendirmeler
0 0 0
Versiyon
0.6
Oluşturulma
02.06.2024
Güncellenme
02.06.2024
Lisans
N/A
Geçerli

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.