🔖 Release version 2.2.1

This commit is contained in:
Younes Aassila 2023-10-10 17:24:08 +02:00 committed by GitHub
commit 44e31a1e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 14 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "ttv-lol-pro",
"version": "2.2.0",
"version": "2.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ttv-lol-pro",
"version": "2.2.0",
"version": "2.2.1",
"license": "GPL-3.0",
"dependencies": {
"bowser": "^2.11.0",

View File

@ -1,6 +1,6 @@
{
"name": "ttv-lol-pro",
"version": "2.2.0",
"version": "2.2.1",
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
"@parcel/bundler-default": {
"minBundles": 10000000,

View File

@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "TTV LOL PRO",
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
"version": "2.2.0",
"version": "2.2.1",
"background": {
"service_worker": "background/background.ts",
"type": "module"

View File

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "TTV LOL PRO",
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
"version": "2.2.0",
"version": "2.2.1",
"background": {
"scripts": ["background/background.ts"],
"persistent": false

View File

@ -92,6 +92,7 @@
<label for="anonymous-mode-checkbox">
Redact my passport information
</label>
<span class="tag">Recommended</span>
<br />
<small>
Watch streams as if you were logged out. This option removes

View File

@ -28,7 +28,7 @@ export function getFetch(options: FetchOptions): typeof fetch {
if (options.shouldWaitForStore) {
setTimeout(() => {
options.shouldWaitForStore = false;
}, 3000);
}, 5000);
}
return async function fetch(
@ -87,15 +87,35 @@ export function getFetch(options: FetchOptions): typeof fetch {
console.debug(
"[TTV LOL PRO] 🥅 Caught GraphQL PlaybackAccessToken_Template request. Flagging…"
);
while (options.shouldWaitForStore) await sleep(100);
if (options.state?.anonymousMode) {
console.log("[TTV LOL PRO] ❓ Acting as anonymous user");
setHeaderToMap(headersMap, "Authorization", "undefined");
removeHeaderFromMap(headersMap, "Client-Session-Id");
removeHeaderFromMap(headersMap, "Client-Version");
setHeaderToMap(headersMap, "Device-ID", generateRandomString(32));
removeHeaderFromMap(headersMap, "Sec-GPC");
removeHeaderFromMap(headersMap, "X-Device-Id");
let graphQlBody = null;
try {
graphQlBody = JSON.parse(requestBody);
} catch {}
const channelName = graphQlBody?.variables?.login as string | undefined;
const whitelistedChannelsLower = options.state?.whitelistedChannels.map(
channel => channel.toLowerCase()
);
const isWhitelisted =
channelName != null &&
whitelistedChannelsLower != null &&
whitelistedChannelsLower.includes(channelName.toLowerCase());
if (options.state?.anonymousMode === true) {
if (!isWhitelisted) {
console.log("[TTV LOL PRO] 🕵️ Anonymous mode is enabled.");
setHeaderToMap(headersMap, "Authorization", "undefined");
removeHeaderFromMap(headersMap, "Client-Session-Id");
removeHeaderFromMap(headersMap, "Client-Version");
setHeaderToMap(headersMap, "Device-ID", generateRandomString(32));
removeHeaderFromMap(headersMap, "Sec-GPC");
removeHeaderFromMap(headersMap, "X-Device-Id");
} else {
console.log(
"[TTV LOL PRO] 🕵️✋ Anonymous mode is enabled but channel is whitelisted."
);
}
}
flagRequest(headersMap);
} else if (