A chrome extension to track the political bias of your news diet to understand others better and help depolarize the political climate
Coming soon
Fairly straightforward, just file an issue or submit a pull request and I'll review it when I can :)
- Clone the repo locally
- Open your chromium browser (chrome, the new edge, etc.) and navigate to chrome://extensions/
- Select
Load Unpacked
, and then navigate to wherever you downloaded this repo - That's it! You're in business
It's a little messy (this is a hobby project), but most functions & should be fairly well documented within code, so i'll just put some high level overview here:
- scripts/eventPage.js: The main background script for the extension. Most of the logic happens here, and content scripts send messages here when they are done working with individual tabs.
- scripts/getUrlsScript.js: A content script that is fired in a new tab just once any time a new tab finishes loading. It grabs all the base domains (i.e. youtube.com) displayed in href's on the page, and sends them back to the eventPage.js as a message. Additionally, it can follow links via issuing HEAD requests on sites like facebook that obfuscate news links. This workaround doesn't work on google news.
- scripts/jquery-3.5.1.min.js: The jQuery minJS, for some utility functions (ajax requests, and JSON loading/parsing)
- scripts/utils.js: Utility functions that are shared between the js files. This should stay fairly lightweight, as it is injected into the background runtime and each of the popup/option pages.
- scripts/popup.js: The popup HTML page's correspoding js code
- scripts/options.js: The options HTML page's correspoding js code
- biasRatings.json: The JSON file with the bias ratings of news sites from allsides.com. These were generated using the allsides scraper, feel free to clone that repo to re-generate the ratings.
- Allen
- You? --> Drop me a line (: