Inspiration
Silence Cookies was inspired by a meme (Laser eyes, silence brand). I also find cookie banners on websites to be very obtrusive and annoying so I wanted a way to block or silence them when I'm on a website.
What it does
Silence Cookies is a content blocking extension that blocks website cookie banners by hiding the element on the page. Silence Cookies does not accept or deny website cookies, it only hides the banner.
How I built it
I used SwiftUI to build an iOS app that displays the instructions for enabling the app on your phone. The actual cookie banner blocking uses an API built into Safari on iOS that allows app developers to make a content blocker extension. To determine what to block, I created a JSON formatted rule list that the API uses to decide what to block on a website. I found an open sourced list of over 10,000 cookie banner rules to use for blocking. I parsed this list of plaintext rules into the JSON format required for the app extension. Each rule specifies a CSS class used on popular website to display cookie banners. If that CSS class exists on the website it is set to display: none; to hide it on the webpage. This is how the cookie banners are hidden.
Once you install the app and enable the content filtering in your settings, the extension will block all cookie banners while you use Safari.
Challenges we ran into
Parsing the rules list into the json was a little tricky at first and Xcode had a hard time handling the file because it was so big.
Accomplishments that we're proud of
I'm amazed at how easy SwiftUI makes it to get a full-fledge iOS app up and running. I was able to build the UI really quickly and cleanly and focus on getting the rules parsed and added to the actual content blocking. I think the app is really good at blocking cookie banners, so I know this is something I'll find useful and use in my everyday life. I'm also very excited to have another app that I can publish on the App Store.
What I learned
I learned how to use iOS's content blocker extension API.
What's next for Silence Cookies
I want to polish it and publish it on the App Store
Log in or sign up for Devpost to join the conversation.