A graph that displays the number of characters sent over time
Installation
Run git clone [email protected]:curtischong/Messenger-Assistant.git in your terminal.
Change const YOUR_NAME = "Curtis"; in settings.js to your name. (Please capitalize your name).
Choose which extensions you want by placing the name of the extension in the EXTENSIONS_TO_LOAD array in settings.js. All extensions are selected by default.
go on messenger.com and the side panel should appear! (You may need to reload messenger.com).
Design Decisions
Each Messenger-Assistant Extension should have an index, script, and syle.css under its directory name in the extensions directory.
The dependencies directory is on the outside so multiple extensions can reuse the same dependencies.
How Create a Messenger Assistant Extension
Put the html, css, and js files for your extension under the extensions directory.
In the manifest.json add the path to your js and css files under content_scripts. Then add the path to your HTML file under web_accessible_resources.
in main.html add <div data-include="<your_extension_name>"></div> in the <div id="extensionsCon">...</div> section.
Put <extensionName>Init() in the initOnPageLoad() function in extensions.js to initialize your extension. Your init function can return variables that will be passed on at every triggered event in extensions.js. Simply put these variables in initVars if you need to reference them later.
Put functions that you want to be called for each event in extensions.js. The current supported events are: initOnPageLoad(), initOnChatLoad(), onRefreshBtnPressed(), and onChatChange().
If your extension needs to make an external network call go into manifest.json and change the website in the content_security_policy section to the url of your website.
Dev Notes
If you update the manifest.json you have to manually turn off/on the extension in the extensions page (Extensions Reloader won't work).
This repo uses ES6 so if you are traversing DOM elements in jquery use .each((idx, element) => {})'; when looping through children elements.
Due to limitations with Chrome extensions, when you create a new file you must delete Messenger Assistant and reload the unpacked version of Messenger Assistant.