mirror of
https://github.com/younesaassila/ttv-lol-pro.git
synced 2025-05-09 02:44:29 +02:00
Update background.js
Removed personal info from redirect url.
This commit is contained in:
parent
849321861b
commit
8bbf309bbd
@ -1,5 +1,18 @@
|
|||||||
|
function stripUnusedParams(str, params) {
|
||||||
|
if (!params) {
|
||||||
|
params = [ 'token', 'sig' ];
|
||||||
|
}
|
||||||
|
var tempUrl = new URL('https://localhost/' + str);
|
||||||
|
for (var i = 0; i < params.length; i++) {
|
||||||
|
tempUrl.searchParams.delete(params[i]);
|
||||||
|
}
|
||||||
|
return tempUrl.pathname.substring(1) + tempUrl.search;
|
||||||
|
}
|
||||||
|
|
||||||
function onPlaylistBeforeRequest(details) {
|
function onPlaylistBeforeRequest(details) {
|
||||||
|
|
||||||
|
details.url = stripUnusedParams(details.url, null);
|
||||||
|
|
||||||
// (hls\/|vod\/)(.+?)$
|
// (hls\/|vod\/)(.+?)$
|
||||||
const match = /(hls|vod)\/(.+?)$/gim.exec(details.url);
|
const match = /(hls|vod)\/(.+?)$/gim.exec(details.url);
|
||||||
|
|
||||||
@ -42,4 +55,4 @@ function onPlaylistBeforeRequest(details) {
|
|||||||
onBeforeSendHeaders,
|
onBeforeSendHeaders,
|
||||||
{ urls: ["https://api.ttv.lol/playlist/*", "https://api.ttv.lol/vod/*"] },
|
{ urls: ["https://api.ttv.lol/playlist/*", "https://api.ttv.lol/vod/*"] },
|
||||||
["blocking", "requestHeaders"]
|
["blocking", "requestHeaders"]
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user