Skip to content

stickerdaniel/fairplay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FairPlay

An iOS app experiment that uses on-device LLMs to detect and neutralize dark patterns in websites. Browse the web with hidden "decline" buttons revealed, manipulative UI exposed, and deceptive design patterns removed.

Goals

  • Dark Pattern Detection - Identify manipulative UI patterns like hidden decline buttons, fake urgency timers, and confusing opt-out flows
  • On-Device Processing - All analysis runs locally using Apple Foundation Models or MLX - no data leaves your device
  • Sanitization - Extract page HTML, analyze with LLM, let user select what to fix and generate js that removes the dark patterns

Limitations

  • Context Window - this is the biggest limitation. Processing real websites could be possible with optimizations that strip away html bloat and irrelevant markup.
  • Server side blindness - is the "only 3 left" a dark pattern or are actually only 3 items left?
  • **Processing speed" - first step would be to implement a caching system that auto applys fixes on subsequent website visits

Requirements

  • iOS 26.2+
  • Xcode 16.0+
  • Device with Apple Intelligence or sufficient RAM for local models

Development Setup

  1. Clone the repository
  2. Open fairplay.xcodeproj in Xcode
  3. Add Swift packages via File → Add Package Dependencies:
  4. Build and run on simulator or device

Hot Reloading with Inject

This project supports hot reloading via Inject. To enable it:

  1. Download InjectionIII and place it in /Applications. Use the GitHub release instead of the App Store version.
  2. Build and run your app in the simulator

The injection bundle loads automatically. Save any Swift file and changes appear instantly without rebuilding!

Architecture

WebView loads page
       ↓
Extract HTML via JavaScript
       ↓
Send to on-device LLM for classification
       ↓
User selects what to fix
       ↓
Send to on-device LLM to generate fix for specific pattern
       ↓
Run js that applies the changes

LLM Backend: LocalLLMClient provides a unified interface for:

  • Apple Foundation Models (on-device)
  • llama.cpp with GGUF models (tried but not compatible with MLX + worse performance)
  • MLX models

For larger models, add com.apple.developer.kernel.increased-memory-limit to your entitlements.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages