Bilibili-Evolved/min/url-params-clean.min.js
2020-10-30 17:42:34 +08:00

1 line
978 B
JavaScript

(()=>(t,e)=>{const o=["spm_id_from","from_source","from_spmid","from","seid","share_source","share_medium","share_plat","share_tag","bbid","ts","timestamp","unique_k","rt","tdsourcetag","accept_quality","broadcast_type","current_qn","current_quality","playurl_h264","playurl_h265","quality_description","network","network_status","platform_network_status","p2p_type","referfrom"];const r=[/game\.bilibili\.com\/fgo/];const s=t=>t;const c=["videocard_series"];const n=()=>{const t=location.search.substring(1).split("&");if(t.some((t=>c.some((e=>t.includes(e)))))){return}const e=t.filter((t=>{if(o.some((e=>t.startsWith(`${e}=`)))){return false}return true}));const r=e.join("&");const n=s(document.URL.replace(location.search,""));const a=r?"?"+r:"";const i=n+a;if(i!==document.URL){console.log("[URL params clean]",document.URL,i);history.replaceState({},document.title,i)}};fullyLoaded((()=>{if(document.contentType==="text/html"){n();Observer.videoChange((()=>n()))}}))})();