Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
odensc committed Nov 8, 2020
0 parents commit a988e1a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"useTabs": true
}
12 changes: 12 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
chrome.webRequest.onBeforeSendHeaders.addListener(
({ requestHeaders }) => {
for (const header of requestHeaders) {
if (header.name.toLowerCase() === "user-agent")
header.value = "Googlebot";
}

return { requestHeaders };
},
{ urls: ["*://*.ttvnw.net/*"] },
["blocking", "requestHeaders"]
);
16 changes: 16 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "TTV ad-block",
"version": "1.0.0",
"description": "Block ads on that certain streaming website",
"manifest_version": 2,
"background": {
"scripts": ["background.js"],
"persistent": true
},
"permissions": [
"*://*.twitch.tv/*",
"*://*.ttvnw.net/*",
"webRequest",
"webRequestBlocking"
]
}

0 comments on commit a988e1a

Please sign in to comment.