Skip to content

Commit

Permalink
Merge pull request #77 from brave/sitehacks
Browse files Browse the repository at this point in the history
Add sitehacks and cosmetic filters from browser-laptop
  • Loading branch information
bbondy authored Oct 28, 2018
2 parents 3f0561f + 8d79584 commit 22a24bc
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ action("brave-extension") {
"$build_dir/js/braveShieldsPanel.bundle.js",
"$build_dir/braveShieldsPanel.html",
"$build_dir/bravelizer.css",
"$build_dir/removeEmptyElements.css",
"$build_dir/siteHack-marketwatch.com.css",
"$build_dir/siteHack-glennbeck.com.js",
"$build_dir/siteHack-coinmarketcap.com.css",
"$build_dir/img/icon-16.png",
"$build_dir/img/icon-32.png",
"$build_dir/img/icon-48.png",
Expand Down
21 changes: 21 additions & 0 deletions app/assets/removeEmptyElements.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.ad-hideable,
.ad-div,
.masthead-ad-control,
.video-ads,
#ad_creative_3,
#footer-ads,
#watch7-sidebar-ads,
.ytp-ad-progress-list,
.ad-container,
#video-masthead,
#watch-channel-brand-div,
#Billboard-ad {
display: none !important;
}

/* YouTube Masthead and Sidebar Ads */
#player-ads.ytd-watch,
ytd-page-manager #masthead-ad.ytd-browse {
display: none !important;
}

5 changes: 5 additions & 0 deletions app/assets/siteHack-coinmarketcap.com.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#icobanner-wrapper,
.container #leaderboard,
.container #leaderboard-bottom {
display: none !important;
}
6 changes: 6 additions & 0 deletions app/assets/siteHack-glennbeck.com.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Site checks indexOf(' gb3...') - Note the leading space.
// Thus we add it after __a=1
document.cookie = '__a=1'
document.cookie = 'gb3lightbox=1'
document.cookie = 'lightbox_ad=true'
console.log('we set some cookies!!')
7 changes: 7 additions & 0 deletions app/assets/siteHack-marketwatch.com.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.element--ad,
.container--bannerAd,
#brass-rail,
.ad.module,
iframe[src*="smartads.epl"] {
display: none !important;
}
34 changes: 34 additions & 0 deletions app/manifest.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,40 @@
],
"run_at": "document_start",
"all_frames": true
}, {
"run_at": "document_start",
"all_frames": true,
"matches": [
"https://www.washingtonpost.com/*",
"https://www.youtube.com/*",
"https://www.yahoo.com/*"
],
"css": [
"removeEmptyElements.css"
]
}, {
"run_at": "document_start",
"all_frames": true,
"matches": [
"https://coinmarketcap.com/*"
],
"css": [
"siteHack-coinmarketcap.com.css"
]
}, {
"run_at": "document_start",
"all_frames": true,
"matches": ["https://www.marketwatch.com/*"],
"css": [
"siteHack-marketwatch.com.css"
]
}, {
"run_at": "document_start",
"all_frames": true,
"matches": ["https://www.glennbeck.com/*"],
"js": [
"siteHack-glennbeck.com.js"
]
}
],
"permissions": [ "contentSettings", "management", "tabs", "storage", "webNavigation", "contextMenus", "cookies", "*://*/*" ],
Expand Down
34 changes: 34 additions & 0 deletions app/manifest.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,40 @@
],
"run_at": "document_start",
"all_frames": true
}, {
"run_at": "document_start",
"all_frames": true,
"matches": [
"https://www.washingtonpost.com/*",
"https://www.youtube.com/*",
"https://www.yahoo.com/*"
],
"css": [
"removeEmptyElements.css"
]
}, {
"run_at": "document_start",
"all_frames": true,
"matches": [
"https://coinmarketcap.com/*"
],
"css": [
"siteHack-coinmarketcap.com.css"
]
}, {
"run_at": "document_start",
"all_frames": true,
"matches": ["https://www.marketwatch.com/*"],
"css": [
"siteHack-marketwatch.com.css"
]
}, {
"run_at": "document_start",
"all_frames": true,
"matches": ["https://www.glennbeck.com/*"],
"js": [
"siteHack-glennbeck.com.js"
]
}
],
"permissions": [ "contentSettings", "management", "tabs", "storage", "webNavigation", "contextMenus", "cookies", "*://*/*" ],
Expand Down

0 comments on commit 22a24bc

Please sign in to comment.