# Reject Cookies - 쿠키를 자동 거부하거나 닫아주는 크롬 확장

> Clean Markdown view of GeekNews topic #20620. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=20620](https://news.hada.io/topic?id=20620)
- GeekNews Markdown: [https://news.hada.io/topic/20620.md](https://news.hada.io/topic/20620.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2025-05-01T09:31:02+09:00
- Updated: 2025-05-01T09:31:02+09:00
- Original source: [blog.bymitch.com](https://blog.bymitch.com/posts/reject-cookies/)
- Points: 6
- Comments: 0

## Summary

웹사이트의 **쿠키 동의 배너**를 자동으로 거부하거나 닫아주는 **Chrome 확장 프로그램**입니다. **비필수 쿠키를 우선 거부**하고 실패 시 **배너를 닫는 방식**을 채택합니다. **Onetrust** 같은 "쿠키 동의 솔루션 벤더"를 탐지하여 **정교한 탐지 및 거부 로직**을 구현하였습니다. 확장은 **Cursor AI 도구와 Vibe 코딩**으로 개발되었으며, 코드는 오픈소스로 제공됩니다.

## Topic Body

- 웹사이트의 **쿠키 동의 배너**를 자동으로 거부하거나 닫아주는 **Chrome 확장 프로그램**  
- 기존의 자동 수락 확장과 달리, 이 확장은 **비필수 쿠키를 우선 거부**하고, 실패 시 **배너를 닫는 방식**을 채택  
- Onetrust 같은 "쿠키 동의 솔루션 벤더"를 탐지하는 방식으로 **정교한 탐지 및 거부 로직**을 구현  
- 확장은 **Cursor AI 도구와 Vibe 코딩**으로 개발되었으며, 코드는 [오픈소스](https://github.com/mitch292/reject-cookies)  
  
### 주요 코드  
  
- 지정된 벤더 탐지를 순차적으로 수행  
  ```ts  
  const findAndClickRejectButtons = () => {  
    commonCookiePopupChecks.forEach(({ check, rejectOrClose }) => {  
      if (check()) {  
        rejectOrClose();  
        return;  
      }  
    });  
  }  
  ```  
- 특정 벤더 찾기: **OneTrust**  
  ```ts  
  const checkForOneTrust = (): boolean => !!document.getElementById('onetrust-consent-sdk');  
  
  const closeOrRejectOneTrust = () => {  
    const rejectButton = document.getElementById('onetrust-reject-all-handler');  
    if (rejectButton) {  
      rejectButton.click();  
      return true;  
    }  
  
    const consentSDK = document.getElementById('onetrust-consent-sdk');  
    if (consentSDK) {  
      consentSDK.remove();  
      return true;  
    }  
    return false;  
  };  
  ```

## Comments



_No public comments on this page._
