- Clone the repository
- Run
npm install
- Run
npm run prod
to generate the minified files inprod/
directory - Open
chrome://extensions
in Google Chrome and click onLoad unpacked
. Load theprod
directory.
- Clone the repository
- Run
npm install
- Running
npm run dev
will start webpack and will watch for the changes insidefeatures/
directory, it creates the resulting files inprod/
directory - If the website you want to create a feature for does not already exist inside features folder create a directory with the website as folder name, create a content script entry point in
prod/manifest.json
- Run
npm run prod
to generate the minified files inprod/
directory.
- The extensions relies heavily on
Mutation Observers
, A common service is created for this inretouch/commons/mutationObserver.js
. - Every registered website will have a directory in which we have a
content.js
for that website. This file register aMutation Observer
instance and passes it to all features so that only a single instance ofMutation Observer
exists.
For example, In removal of facebook stories we have
const mutationObserverInstance = new MutationObserverService();
removeStories(mutationObserverInstance);
- Mutation Observer class provides a method to update the watchlist and expects the arguments in a specific format
{
'type': 'nodeAdded',
'DOMIdentifier': '#fb_stories_card_root',
'action': performRemoval
}