Chrome extension to reject cookies
This commit is contained in:
commit
b374e5897e
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Reject Cookies Extension
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
A Chrome extension to reject cookies. Interacts with cookie consent popups on websites based on predefined selectors.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Rejects cookie consent popups
|
||||||
|
- Configurable with multiple selectors to handle different types of popups.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. **Clone the repository** or **download** the code.
|
||||||
|
|
||||||
|
2. **Open Chrome** and go to `chrome://extensions/.`
|
||||||
|
|
||||||
|
4. Enable **Developer Mode** by toggling the switch in the top-right corner.
|
||||||
|
|
||||||
|
5. Click **Load unpacked** and select the project directory (~/Downloads/reject-cookies).
|
||||||
|
|
||||||
|
The extension should now appear in your list of extensions.
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
const selectors = [
|
||||||
|
'button[aria-label="reject"]',
|
||||||
|
'button[data-testid="reject"]',
|
||||||
|
'button[class*="reject"]',
|
||||||
|
];
|
||||||
|
|
||||||
|
function clickButton(selector) {
|
||||||
|
const button = document.querySelector(selector);
|
||||||
|
if (button) {
|
||||||
|
button.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
selectors.forEach(selector => {
|
||||||
|
clickButton(selector);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"manifest_version": 3,
|
||||||
|
"name": "Reject Cookies",
|
||||||
|
"version": "1.0",
|
||||||
|
"description": "Automatically reject all cookie popups.",
|
||||||
|
"permissions": ["activeTab", "scripting"],
|
||||||
|
"background": {
|
||||||
|
"service_worker": "background.js"
|
||||||
|
},
|
||||||
|
"content_scripts": [
|
||||||
|
{
|
||||||
|
"matches": ["<all_urls>"],
|
||||||
|
"js": ["content.js"],
|
||||||
|
"run_at": "document_end"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue