commit a4114d9ad428792279375f5fc4b3869737e1c99d Author: thecookingsenpai Date: Mon Dec 25 13:25:10 2023 +0100 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..69eabcf --- /dev/null +++ b/README.md @@ -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 :) diff --git a/boost.config.json b/boost.config.json new file mode 100644 index 0000000..dc2e543 --- /dev/null +++ b/boost.config.json @@ -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} \ No newline at end of file diff --git a/content.js b/content.js new file mode 100644 index 0000000..0bee615 --- /dev/null +++ b/content.js @@ -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() diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..a86bfb9 --- /dev/null +++ b/manifest.json @@ -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": [] +} \ No newline at end of file