mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix url params clean (fix #1520)
This commit is contained in:
parent
cba01b6dd9
commit
1922a3a054
2
min/url-params-clean.min.js
vendored
2
min/url-params-clean.min.js
vendored
@ -1 +1 @@
|
||||
(()=>(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","visit_id","bsource","spm","hotRank"];const i=[{match:/\/\/www\.bilibili\.com\/audio\/(au[\d]+|mycollection)/,param:"type"},{match:/\/\/live\.bilibili\.com\//,param:"session_id"},{match:/\/\/www\.bilibili\.com\/bangumi\//,param:"theme"},{match:/\/\/t\.bilibili\.com\/[\d]+/,param:"type"}];const s=[/game\.bilibili\.com\/fgo/];const a=t=>t;const r=["videocard_series"];const c=()=>{const t=location.search.substring(1).split("&");if(t.some((t=>r.some((e=>t.includes(e)))))){return}const e=t.filter((t=>{if(o.some((e=>t.startsWith(`${e}=`)))){return false}if(i.some((({match:e,param:o})=>document.URL.match(e)&&t.startsWith(`${o}=`)))){return false}return true}));const s=e.join("&");const c=a(document.URL.replace(location.search,""));const m=s?"?"+s:"";const n=c+m;if(n!==document.URL){console.log("[URL params clean]",document.URL,n);history.replaceState({},document.title,n)}};fullyLoaded((()=>{if(document.contentType==="text/html"){c();Observer.videoChange((()=>c()))}}))})();
|
||||
(()=>(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","visit_id","bsource","spm","hotRank"];const s=[{match:/\/\/www\.bilibili\.com\/audio\/(au[\d]+|mycollection)/,param:"type"},{match:/\/\/live\.bilibili\.com\//,param:"session_id"},{match:/\/\/www\.bilibili\.com\/bangumi\//,param:"theme"}];const i=[/game\.bilibili\.com\/fgo/];const r=t=>t;const a=["videocard_series"];const c=()=>{const t=location.search.substring(1).split("&");if(t.some((t=>a.some((e=>t.includes(e)))))){return}const e=t.filter((t=>{if(o.some((e=>t.startsWith(`${e}=`)))){return false}if(s.some((({match:e,param:o})=>document.URL.match(e)&&t.startsWith(`${o}=`)))){return false}return true}));const i=e.join("&");const c=r(document.URL.replace(location.search,""));const n=i?"?"+i:"";const m=c+n;if(m!==document.URL){console.log("[URL params clean]",document.URL,m);history.replaceState({},document.title,m)}};fullyLoaded((()=>{if(document.contentType==="text/html"){c();Observer.videoChange((()=>c()))}}))})();
|
||||
@ -44,10 +44,6 @@ const siteSpecifiedParams = [
|
||||
match: /\/\/www\.bilibili\.com\/bangumi\//,
|
||||
param: 'theme',
|
||||
},
|
||||
{
|
||||
match: /\/\/t\.bilibili\.com\/[\d]+/,
|
||||
param: 'type',
|
||||
},
|
||||
]
|
||||
const noNormalizes = [
|
||||
/game\.bilibili\.com\/fgo/,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user