// ==UserScript== // @name Facebook Script for useful helper features // @version 2.0.2 // @namespace https://github.com/HungNth/userscripts // @license MIT // @description A Facebook toolkit for streamlining browsing, cleaning links, and adding useful helper features. // @author HungNth // @match *://*.facebook.com/* // @icon https://www.google.com/s2/favicons?domain=facebook.com // @grant GM_setClipboard // ==/UserScript== !function(){"use strict";const t=["fbclid","fb_action_ids","fb_action_types","fb_source","fb_ref","fbid","action_object_map","action_type_map","action_ref_map","utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id","utm_source_platform","utm_creative_format","utm_marketing_tactic","gclid","gclsrc","gbraid","wbraid","msclkid","ref","referral","_hsenc","_hsmi","mc_cid","mc_eid","igshid","yclid","zanpid","dclid","srsltid"];document.addEventListener("contextmenu",function(e){let n=e.target;for(;n&&"A"!==n.tagName;)n=n.parentElement;if(!n||"A"!==n.tagName||!n.href)return;let x=n.href,i=null;const o=x.match(/[?&]u=([^&]+)/);if(i=o?decodeURIComponent(o[1]):x,i=(e=>{try{const n=new URL(e);return t.forEach(t=>n.searchParams.delete(t)),n.toString()}catch{return e}})(i),i&&i!==x){const t=(t=>{const e=document.createElement("button");return e.style.position="absolute",e.style.zIndex="1000",e.style.backgroundColor="#007bff",e.style.color="#fff",e.style.border="none",e.style.padding="5px 10px",e.style.borderRadius="4px",e.style.cursor="pointer",e.style.display="flex",e.style.alignItems="center",e.style.gap="5px",e.innerHTML=' Copy Real Link',e.onclick=()=>{GM_setClipboard(t),e.textContent="Copied!",setTimeout(()=>e.remove(),2e3)},e})(i);document.body.appendChild(t);const e=n.getBoundingClientRect();t.style.top=`${e.top+window.scrollY}px`,t.style.left=`${e.right+window.scrollX+5}px`,setTimeout(()=>t.remove(),5e3)}});const e='\n [id^="mount_0_0_"] > div > div:first-child > div.x9f619.x1n2onr6.x1ja2u2z\n > div.x9f619.x1n2onr6.x1ja2u2z:nth-child(4)\n > div.x78zum5.xdt5ytf.x1n2onr6.x1ja2u2z\n > div.x78zum5.xdt5ytf.x1n2onr6.xat3117.xxzkxad\n > div.x78zum5.xdt5ytf.x1t2pt76.x1n2onr6.x1ja2u2z.x10cihs4:first-child\n > div.x9f619.x1ja2u2z.x78zum5.x2lah0s.x1n2onr6.xl56j7k.x1qjc9v5.xozqiw3.x1q0g3np.x1t2pt76.x17upfok:first-child\n > div.x9f619.x1ja2u2z.x78zum5.x1n2onr6.x1r8uery.x1iyjqo2.xs83m0k.xeuugli.x1qughib.x1cy8zhl.xozqiw3.x1q0g3np.xylbxtu.x1t2pt76.xornbnt\n > div.x9f619.x1ja2u2z.xnp8db0.x112wk31.xnjgh8c.xxc7z9f.x1t2pt76.x1u2d2a2.x6ikm8r.x10wlt62.x7wzq59.xxzkxad.x1daaz14:last-child\n > div.x9f619.x1n2onr6.x1ja2u2z.x78zum5.xdt5ytf.xedcshv.x1t2pt76\n > div.xb57i2i.x1q594ok.x5lxg6s.x78zum5.xdt5ytf.x6ikm8r.x1ja2u2z.x1pq812k.x1rohswg.xfk6m8.x1yqm8si.xjx87ck.x1l7klhg.x1iyjqo2.xs83m0k.x2lwn1j.xx8ngbg.xwo3gff.x1oyok0e.x1odjw0f.x1n2onr6.xq1qtft\n > div.x78zum5.xdt5ytf.x1iyjqo2.x1n2onr6:first-child\n > div.x1y1aw1k\n '.replace(/\s+/g," ").trim();function n(){document.querySelectorAll(e).forEach(t=>{t.remove()})}n();new MutationObserver(()=>{n()}).observe(document.documentElement,{childList:!0,subtree:!0})}();