TikTok to TikWM Redirect

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

Autor
femto
Dnevne instalacije
0
Ukupno instalacija
40
Ocene
0 0 0
Verzija
0.6
Napravljeno
02/06/2024
Ažurirano
02/06/2024
Licenca
Nije dostupno
Važi za

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.