Clean up your Facebook feed by removing unwanted content like Reels, Stories, sponsored posts, and suggestions.
A powerful, cross-platform browser extension that gives you control over what you see on Facebook. Built with TypeScript, React, and Tailwind CSS using a modular, feature-based architecture.
| Feature | Description |
|---|---|
| β Clean Mode | Master toggle to enable/disable all filtering features at once |
| π Remove Stories | Hide the stories tray from your feed |
| π¬ Remove Reels | Hide all Reels from your feed |
| π° Remove Sponsored Posts | Block all sponsored and promoted content |
| π₯ Remove Suggested Posts | Hide βSuggested for youβ posts |
| πͺ Remove Marketplace Ads | Filter out Marketplace advertisements |
| π Remove Search Ads | Clean sponsored results in search |
| π€ Remove People You May Know | Filter friend suggestions |
| π― Remove Group Suggestions | Hide group suggestions |
chrome://extensions/ or edge://extensions/.xpi file from Releasesabout:addons.xpi fileSee Development Guide below.
# Clone the repository
git clone https://github.com/user/clarity-for-facebook.git
cd clarity-for-facebook
# Install dependencies
npm install
# Start development mode (with hot reload)
npm run dev
clarity-for-facebook/
βββ src/
β βββ background/ # Background service worker
β β βββ background.ts
β βββ content/ # Content scripts (DOM manipulation)
β β βββ contentScript.ts # Main orchestrator
β β βββ content.css # Injected styles
β β βββ features/ # Feature modules (modular architecture)
β β β βββ base.feature.ts # Base class for all features
β β β βββ reels.feature.ts
β β β βββ stories.feature.ts
β β β βββ suggested.feature.ts
β β β βββ people-you-may-know.feature.ts
β β β βββ group-suggestions.feature.ts
β β β βββ index.ts
β β βββ services/ # Shared services
β β βββ observer.service.ts # DOM MutationObserver
β β βββ post-parser.service.ts # Facebook post parsing
β β βββ settings.service.ts # Settings management
β β βββ style-injector.service.ts
β βββ popup/ # React popup UI
β β βββ components/
β β β βββ Popup.tsx # Main popup component
β β β βββ Header.tsx # Header with actions
β β β βββ Footer.tsx # Footer with links
β β β βββ FeatureToggle.tsx # Toggle component
β β β βββ icons/ # Custom SVG icon components
β β β βββ CleanModeIcon.tsx
β β β βββ RemoveStoriesIcon.tsx
β β β βββ RemoveReelsIcon.tsx
β β β βββ RemoveSponsoredIcon.tsx
β β β βββ RemoveSuggestedIcon.tsx
β β β βββ RemoveMarketplaceIcon.tsx
β β β βββ RemoveSearchAdsIcon.tsx
β β β βββ RemovePeopleYouMayKnowIcon.tsx
β β β βββ RemoveGroupSuggestionsIcon.tsx
β β β βββ index.ts
β β βββ index.tsx
β β βββ popup.html
β β βββ styles.css
β βββ types/ # TypeScript type definitions
β β βββ index.ts
β βββ constants/ # Constants and configuration
β β βββ index.ts
β β βββ extension.constant.ts # Extension settings & features
β β βββ observer.constant.ts # Observer configuration
β β βββ facebook-selectors.constant.ts # Multi-language selectors
β βββ utils/ # Utility functions
β β βββ storage.ts
β β βββ helpers.ts
β βββ icons/ # Extension icons
β βββ icon.svg
β βββ icon-16.png
β βββ icon-32.png
β βββ icon-48.png
β βββ icon-128.png
βββ manifests/ # Browser-specific manifests
β βββ manifest.chrome.json
β βββ manifest.firefox.json
β βββ manifest.edge.json
βββ dist/ # Build output (generated)
β βββ chrome/
β βββ firefox/
β βββ edge/
βββ webpack.config.js
βββ tsconfig.json
βββ tailwind.config.js
βββ package.json
# Development
npm run dev # Build and watch for changes
# Production Build
npm run build # Build for current browser
npm run build:chrome # Build for Chrome
npm run build:firefox # Build for Firefox
npm run build:edge # Build for Edge
npm run build:all # Build for all browsers
# Code Quality
npm run type-check # Run TypeScript type checking
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint errors
# Utilities
npm run clean # Clean dist folder
Start Development Mode
npm run dev
Load Extension in Browser
chrome://extensions/, enable βDeveloper modeβ, click βLoad unpackedβ, select dist/chromeabout:debugging#/runtime/this-firefox, click βLoad Temporary Add-onβ, select manifest.json from dist/firefoxedge://extensions/Make Changes
src/ directoryDebug
chrome://extensions/ β Click βservice workerβ link under extensionThe content script uses a modular feature-based architecture:
BaseFeature (abstract)
βββ ReelsFeature
βββ StoriesFeature
βββ SuggestedPostsFeature
βββ PeopleYouMayKnowFeature
βββ GroupSuggestionsFeature
Each feature implements:
shouldProcess(element) - Determine if element should be processedprocess(element) - Hide/remove the elementcleanMode acts as a master switch:
src/content/features/new.feature.ts)import { BaseFeature } from './base.feature';
import type { ExtensionSettings } from '@/types';
export class NewFeature extends BaseFeature {
constructor(settings: ExtensionSettings) {
super(settings, 'newFeature');
}
shouldProcess(element: Element): boolean {
// Detection logic
return /* condition */;
}
process(element: HTMLElement): void {
element.style.display = 'none';
}
}
src/content/features/index.ts)export { NewFeature } from './new.feature';
src/types/index.ts)export type FeatureKey = 'newFeature' | /* existing types */;
src/constants/extension.constant.ts)export const FEATURES: Feature[] = [
{
key: 'newFeature',
label: 'New Feature',
description: 'Description of new feature',
enabled: true,
},
// ... existing features
];
src/popup/components/icons/NewFeatureIcon.tsx)Facebook selectors support multiple languages. Update in src/constants/facebook-selectors.constant.ts:
export const SPONSORED_TEXTS = [
'Sponsored', // English
'Δược tΓ i trợ', // Vietnamese
'γΉγγ³γ΅γΌ', // Japanese
// Add more languages...
];
The extension uses CSS pre-hiding to prevent flickering. If you still see issues:
content.css is being loadedContributions are welcome! Please follow these guidelines:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ for a cleaner Facebook experience
β Star this repo if you find it useful!