Greasy Fork is available in English.

Copy Modified URL on Click Twitter

Copies fxtwitter links into your clipboard. Will make you share TikTok videos easier on platforms like Telegram and Discord.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Copy Modified URL on Click Twitter
// @match        https://twitter.com/*
// @description Copies fxtwitter links into your clipboard. Will make you share TikTok videos easier on platforms like Telegram and Discord.
// @license MIT
// @version 0.0.1.20230708182235
// @namespace https://greasyfork.org/users/1122038
// ==/UserScript==
(function() {
  'use strict';

  // Function to handle the document click event
  function handleClick(event) {
    // Get the current URL
    var currentURL = window.location.href;

    // Modify the URL to use "vxtiktok.com"
    var modifiedURL = currentURL.replace(/^(https?:\/\/)(www\.)?([^\/]+)/i, "$1fxtwitter.com");

    // Copy the modified URL to the clipboard
    navigator.clipboard.writeText(modifiedURL)
      .then(function() {
        console.log('Modified URL copied to clipboard:', modifiedURL);
      })
      .catch(function(error) {
        console.error('Failed to copy the modified URL:', error);
      });
  }

  // Add a click event listener to the document
  document.addEventListener('click', handleClick);
})();