Select Language:
If you’re trying to stop a website from repeatedly asking you for cookie consent, here’s a simple way to handle it with a quick solution. Sometimes, these cookie prompts can pop up often, especially on sites that keep asking for your approval. Luckily, there’s an easy fix by adding a small piece of code to your browser.
First, ensure you’re comfortable editing your browser’s settings or using a browser extension that allows custom scripts, like a userscript manager. Then, you can insert a script that will tell the site to skip the cookie consent prompt altogether. Here’s an example of what that code looks like:
javascript
// Wait for the page to load
window.addEventListener(‘load’, () => {
// Find the cookie consent dialog
const consentDialog = document.querySelector(‘#ghcc’);
// If the dialogue exists, hide it
if (consentDialog) {
consentDialog.style.display = ‘none’;
// Also, set a cookie or local storage to remember your choice
document.cookie = “cookie_consent=accepted; path=/; max-age=31536000”; // 1 year
}
});
This code waits until the page is fully loaded, finds the cookie consent banner, and then hides it. It also sets a cookie so that the site remembers you’ve accepted or dismissed the prompt.
To implement this:
1. Use a browser extension that enables custom scripts or snippets.
2. Paste the code into the script area.
3. Reload the site.
Once set up, the site should no longer bother you with cookie prompts. Remember, this is a quick fix and might not work on all websites, but for sites with similar structures, it often does the trick. Always be cautious when using scripts and ensure they come from trusted sources.

