src
├── assets # Static images & files
├── background # Manages the background script processes
│ ├── protection
│ │ ├── background.js
│ │ ├── listeners-chrome.js
│ │ ├── listeners-firefox.js
│ │ ├── protection-ff.js
│ │ └── protection.js
│ ├── control.js
│ └── storage.js
├── common # Manages header sending and rules
│ ├── editDomainlist.js
│ └── editRules.js
├── content-scripts # Runs processes on site on adds DOM signal
│ ├── injection
│ │ └── gpc-dom.js
│ ├── registration
│ │ └── gpc-dom.js
│ └── contentScript.js
├── data # Stores constant data (DNS signals, settings, etc.)
│ ├── defaultSettings.js
│ ├── headers.js
│ └── regex.js
├── manifests # Stores manifests
│ ├── chrome
│ │ ├── manifest-dev.json
│ │ └── manifest-dist.json
│ ├── firefox
│ │ ├── manifest-dev.json
│ │ └── manifest-dist.json
├── options # Options page frontend
│ ├── components
│ │ ├── scaffold-component.html
│ │ └── util.js
│ ├── views
│ │ ├── about-view
│ │ │ ├── about-view.html
│ │ │ └── about-view.js
│ │ ├── domainlist-view
│ │ │ ├── domainlist-view.html
│ │ │ └── domainlist-view.js
│ │ ├── main-view
│ │ │ ├── main-view.html
│ │ │ └── main-view.js
│ │ └── settings-view
│ │ ├── settings-view.html
│ │ └── settings-view.js
│ ├── dark-mode.css
│ ├── options.html
│ ├── options.js
│ └── styles.css
├── popup # Popup page frontend
│ ├── popup.html
│ ├── popup.js
│ └── styles.css
├── rules # Manages universal rules
│ ├── gpc_exceptions_rules.json
│ └── universal_gpc_rules.json
└── theme # Contains darkmode
└── darkmode.js
test
└── background
└── gpc.test.jsThe following source folders have detailed descriptions further in the document.
background
common
content-scripts
data
manifests
options
popup
rules
theme
protectioncontrol.jsstorage.js
background.jslisteners-chrome.jslisteners-firefox.jsprotection.jsprotection-ff.js
Initializes the protection mode listeners.
Creates listeners for Chrome and Firefox, respectively.
Manages the domain list with functions like logData();, updateDomainlistAndSignal();, pullToDomainlistCache();, syncDomainlists();. Also responsible for supplying the popup with the proper information with dataToPopup();. Also creates listeners to watch the popup for domain list changes.
Manages the domain list for Firefox.
Uses protection.js to turn the extension on and off.
Handles storage uploads and downloads.
editDomainlist.jseditRules.js
This folder holds common internal API's to be used throughout the extension.
Is an internal API to be used for editing a users domain list.
Is an internal API to be used for editing rules that allow us to send the GPC header.
injectionregistrationcontentScript.js
This folder contains our main content script and methods for injecting the GPC signal into the DOM.
gpc-dom.js
gpc-dom.js injects the DOM signal.
gpc-dom.js
This file injects injection/gpc-dom.js into the page using a static script. (Based on this stack overflow thread)
This runs on every page and sends information to signal background processes.
defaultSettings.jsheaders.jsregex.js
This folder contains static data.
Contains the default OptMeowt settings.
Contains the default headers to be attached to online requests.
Contains regular expressions for finding "do not sell" links and related privacy signals.
chromefirefox
Contains the extension manifests
manifest-dev.jsonmanifest-dist.json
Contains the development and distribution manifests for Chrome
manifest-dev.jsonmanifest-dist.json
Contains the development and distribution manifests for Firefox
componentsviewsdark-mode.cssoptions.html
This folder contains all of the frontend code
scaffold-component.htmlutil.js
This folder contains the basic layout of every options page and helper functions to help render the pages.
about-viewdomainlist-viewmain-viewsettings-view
Contains all frontend and implementation of the settings pages.
about-view.htmlabout-view.js
Builds the "about" page
domainlist-view.htmldomainlist-view.js
Builds the domain list page
main-view.htmlmain-view.js
Builds the main options page
settings-view.htmlsettings-view.js
Builds the settings page
Contains the dark-mode styles for OptMeowt.
Is the entry point for the main options page.
Contains the basic styles for OptMeowt.
popup.htmlpopup.jsstyles.css
Contains the frontend and implementation for the OptMeowt popup.
gpc_exception_rules.jsonuniversal_gpc_rules.json
Contains rule framework for sending GPC headers to sites.
darkmode.js
Contains the dark mode functionality.
Links to APIs:
Chrome: webRequest and webNavigation
Firefox: webRequest and webNavigation