Bilibili-Evolved/min/url-params-clean.min.js
2020-01-07 14:24:56 +08:00

1 line
493 B
JavaScript

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