Skip to content

Commit

Permalink
fix: just don't do anything anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Nov 29, 2022
1 parent 88379ed commit 22b9097
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ videos
.idea
.code
.vscode
ak
as
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "TTV-Tools",
"version": "0.5.5",
"version": "0.5.6",
"description": "Common helpers when watching twitch",
"background": {
"scripts": [
Expand Down
9 changes: 2 additions & 7 deletions src/background/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import { onAdPod, StreamTabs } from './ad.replacement';
import { TWITCH_USER_PAGE } from './utilities/request.utilities';
import { eventHandler } from './utilities/messaging';
import { TwitchStitchedAdData } from './twitch-m3u8.types';
import { parseMediaPlaylist } from './hls/hls-parser';
import { writePlaylist } from './hls/hls-writer';
import { mergePlayer } from './player-merging';

function onRequest(request: _OnBeforeRequestDetails) {
if (!request.url.includes('video-weaver')) return;

Expand All @@ -33,7 +29,7 @@ function onRequest(request: _OnBeforeRequestDetails) {
};

extractAdData(text, request.documentUrl ?? '', request.tabId);
finalWrite(await mergePlayer(request.tabId, text));
finalWrite(cleanupAllAdStuff(text));
};

filter.onstop = () => {
Expand Down Expand Up @@ -94,8 +90,7 @@ function cleanupAllAdStuff(data: string) {
'X-TV-TWITCH-AD-CLICK-TRACKING-URL="javascript:alert(\'pogo\')"'
)
.replace(/X-TV-TWITCH-AD-ADVERIFICATIONS="[^"]+"/g, `X-TV-TWITCH-AD-ADVERIFICATIONS="${btoa('{}')}"`)
.replace(/#EXT-X-DATERANGE.+CLASS=".*ad.*".+\n/g, '')
.replace(/\n#EXTINF.+(?<!live)\nhttps:.+/g, '');
.replace(/#EXT-X-DATERANGE.+CLASS=".*ad.*".+\n/g, '');
}

function extractAdData(data: string, doc: string, tabId: number) {
Expand Down

0 comments on commit 22b9097

Please sign in to comment.