Bilibili-Evolved/min/url-params-clean.min.js
2020-02-17 20:45:07 +08:00

1 line
512 B
JavaScript

(()=>{return(e,t)=>{const r=["spm_id_from","from_source","from","seid","share_source","share_medium","bbid","ts","rt","tdsourcetag"];const s=()=>{const e=location.search.substring(1).split("&");const t=e.filter(e=>{if(r.some(t=>e.startsWith(`${t}=`))){return false}return true});if(e.length!==t.length){const e=t.join("&");const r=document.URL.replace(location.search,e?"?"+e:"");console.log("[URL params clean]",document.URL,r);history.replaceState({},document.title,r)}};s();Observer.videoChange(()=>s())}})();