-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/* | ||
github.com/n0nexist/AdSmack | ||
*/ | ||
|
||
// List of regex patterns to block | ||
const BLOCKED_URLS = [ | ||
"*://*.doubleclick.net/*", | ||
"*://partner.googleadservices.com/*", | ||
"*://adservice.google.com/*", | ||
"*://*.googlesyndication.com/*", | ||
"*://*.google-analytics.com/*", | ||
"*://creative.ak.fbcdn.net/*", | ||
"*://*.adbrite.com/*", | ||
"*://*.exponential.com/*", | ||
"*://*.quantserve.com/*", | ||
"*://*.scorecardresearch.com/*", | ||
"*://*.zedo.com/*", | ||
"*://*.adblade.com/*", | ||
"*://*.adclickmedia.com/*", | ||
"*://*.adnxs.com/*", | ||
"*://*.adroll.com/*", | ||
"*://*.adserver.com/*", | ||
"*://*.adtech.com/*", | ||
"*://*.atdmt.com/*", | ||
"*://*.casalemedia.com/*", | ||
"*://*.chitika.com/*", | ||
"*://*.clicksor.com/*", | ||
"*://*.criteo.com/*", | ||
"*://*.districtm.net/*", | ||
"*://*.dynamicyield.com/*", | ||
"*://*.engagebdr.com/*", | ||
"*://*.fastclick.com/*", | ||
"*://*.flashtalking.com/*", | ||
"*://*.gemini.yahoo.com/*", | ||
"*://*.imrworldwide.com/*", | ||
"*://*.infolinks.com/*", | ||
"*://*.intellimize.com/*", | ||
"*://*.jsdelivr.net/*", | ||
"*://*.krxd.net/*", | ||
"*://*.liveintent.com/*", | ||
"*://*.maxmind.com/*", | ||
"*://*.media.net/*", | ||
"*://*.mediaplex.com/*", | ||
"*://*.mgid.com/*", | ||
"*://*.moatads.com/*", | ||
"*://*.monetate.net/*", | ||
"*://*.nativeads.com/*", | ||
"*://*.ooyala.com/*", | ||
"*://*.outbrain.com/*", | ||
"*://*.perimeterx.net/*", | ||
"*://*.pixel.adsafeprotected.com/*", | ||
"*://*.pubmatic.com/*", | ||
"*://*.quantummetric.com/*", | ||
"*://*.redditads.com/*", | ||
"*://*.revcontent.com/*", | ||
"*://*.rubiconproject.com/*", | ||
"*://*.sharethrough.com/*", | ||
"*://*.simpli.fi/*", | ||
"*://*.smartadserver.com/*", | ||
"*://*.taboola.com/*", | ||
"*://*.tapad.com/*", | ||
"*://*.teads.tv/*", | ||
"*://*.hotjar.*/*", | ||
"*://*events.hotjar.io/*", | ||
"*://*.ads-twitter.com/*", | ||
"*://*analytics.twitter.com/*", | ||
"*://*ads.twitter.com/*", | ||
"*://*ads-api.twitter.com/*", | ||
"*://*s3.amazonaws.com/*", | ||
"*://*advertising*amazonaws.com/*", | ||
"*://*.adcolony.com/*", | ||
"*://app-measurement.com/*", | ||
"*://analytics.google.com/*", | ||
"*://*.googleanalytics.com/*", | ||
"*://*.freshmarketer.com/*", | ||
"*://*freshmarketer.com/*", | ||
"*://stats.wp.com/*", | ||
"*://*.luckyorange.*/*", | ||
"*://luckyorange.com/*", | ||
"*://*.sentry-cdn.*/*", | ||
"*://*.bugsnag.*/*", | ||
"*://pixel.facebook.com/*", | ||
"*://an.luckyorange.com/*", | ||
"*://*.redditmedia.com/*", | ||
"*://events.reddit.com/*", | ||
"*://ads-api.tiktok.*/*", | ||
"*://analytics.tiktok.*/*", | ||
"*://analytics-sg.tiktok.*/*", | ||
"*://business-api.tiktok.*/*", | ||
"*://ads.tiktok.*/*", | ||
"*://ads.youtube.com/*", | ||
"*://ads.pinterest.*/*", | ||
"*://log.pinterest.*/*", | ||
"*://analytics.pinterest.*/*", | ||
"*://trk.pinterest.*/*", | ||
"*://widgets.pinterest.*/*", | ||
"*://ads.yahoo.*/*", | ||
"*://geo.yahoo.*/*", | ||
"*://udc.yahoo.*/*", | ||
"*://udcm.yahoo.*/*", | ||
"*://analytics.query.yahoo.*/*", | ||
"*://partnerads.ysm.yahoo.*/*", | ||
"*://log.fc.yahoo.*/*", | ||
"*://gemini.yahoo.*/*", | ||
"*://adtech.yahoo.*/*", | ||
"*://extmaps-api.yandex.*/*", | ||
"*://appmetrica.yandex.*/*", | ||
"*://adfstat.yandex.*/*", | ||
"*://metrika.yandex.*/*", | ||
"*://advertising.yandex.*/*", | ||
"*://offerwall.yandex.*/*", | ||
"*://*.unityads.unity3d.com/*", | ||
]; | ||
|
||
// Short adblock script | ||
browser.webRequest.onBeforeRequest.addListener( | ||
function(details) { | ||
// Check if the request URL matches any of the blocked patterns | ||
// Using regular expressions | ||
for (let pattern of BLOCKED_URLS) { | ||
let regex = new RegExp(pattern.replace(/\*/g, '.*')); | ||
if (regex.test(details.url)) { | ||
// Drops the request | ||
return {cancel: true}; | ||
} | ||
} | ||
}, | ||
{urls: ["<all_urls>"]}, // Make this work on all urls | ||
["blocking"] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "AdSmack", | ||
"version": "1.2.3", | ||
"description": "made by n0nexist.github.io", | ||
"browser_action": { | ||
"default_title": "AdSmack", | ||
"default_popup": "menu.html" | ||
}, | ||
"permissions": ["webRequest", "webRequestBlocking", "<all_urls>"], | ||
"background": { | ||
"scripts": ["background.js"], | ||
"persistent": false | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>AdSmack</title> | ||
<style> | ||
body { | ||
font-family: 'Times New Roman', Times, serif; | ||
font-size: 12px; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
h1 { | ||
font-size: 16px; | ||
font-weight: bold; | ||
margin: 0 0 10px; | ||
} | ||
|
||
body { | ||
background: black; | ||
color: red; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h2> AdSmack </h2> | ||
<center><h4>by <a href="https://n0nexist.github.io/" style = "color: rgb(168, 19, 19)">n0nexist</a></h4></center> | ||
</body> | ||
</html> |