Initial commit

This commit is contained in:
thecookingsenpai 2023-12-25 13:25:10 +01:00
commit a4114d9ad4
4 changed files with 60 additions and 0 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# thegigabrain.com Enhancer
## An Arc Browser boost to have a better experience with thegigabrain.com
### Remove the annoying banner on thegigabrain.com
thegigabrain.com reminds us of installing their (indeed great) chrome extension. The problem is: even if you actually install the extension (like I have done), there is no way to hide that banner. Oh wait, now there is :)

1
boost.config.json Normal file
View File

@ -0,0 +1 @@
{"installedInProfiles":[{"default":{}}],"extensionId":"pidljjebaompmmdpcpjcpaeohnlipcih","pinned":false,"scope":"thegigabrain.com","id":"7e735608-cf32-4acd-9d78-7456aab88a67","components":{"contentScript":{"enabled":true,"path":"content.js"}},"name":"Remove the annoying banner on thegigabrain.com","extensionEnabled":true}

35
content.js Normal file
View File

@ -0,0 +1,35 @@
// Utilities
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
// Core method
function removeExtensionBanners() {
// Scanning for banners
let elements = document.getElementsByClassName("ExtPushBannerContainer")
if (elements.length > 0) {
console.log("Found extension banners. Cleaning up...")
} else return
// Iterating through banners and removing them
for (let i=0; i < elements.length; i++) {
try {
elements[i].remove()
console.log("Removed banner #" + (i+1))
} catch (e) {
console.log(e)
}
}
console.log("Done.")
}
// Entry point
async function main() {
// eslint-disable-next-line no-constant-condition
while (true) { // Not the most elegant way but is virtually harmless
await sleep(1000) // Let's not overload the resource usage with this while loop
removeExtensionBanners()
}
}
// Let's-a-go!
main()

17
manifest.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "Remove the annoying banner on thegigabrain.com",
"description": "thegigabrain.com reminds us of installing their (indeed great) chrome extension. The problem is: even if you actually install the extension (like I have done), there is no way to hide that banner. Oh wait, now there is :)",
"version": "0.0.1",
"manifest_version": 3,
"content_scripts": [
{
"matches": [
"*://*.thegigabrain.com/*"
],
"js": [
"content.js"
]
}
],
"permissions": []
}