aboutsummaryrefslogtreecommitdiffstats
path: root/main.js
AgeCommit message (Collapse)Author
2021-03-21Rename `main.js` to `main.js.in`Teddy Wing
Since this file has template variables, it's not a real executable JavaScript file. Add `.in` to the end to make it clear it needs to be built with Make.
2021-03-21Makefile: Add build rules to build dependencies into main.jsTeddy Wing
Instead of copy-pasting the code from the files directly into main.js, do it in the build recipes.
2021-03-21Work out the proper way to import scriptsTeddy Wing
In order to import our script dependencies and inject them correctly into the page, we need to remove the existing IIFEs, append them to the page in `<script>` tags, and wrap them in custom IIFEs. If I leave the original IIFEs, they get executed too early, and I can't insert the scripts into the page correctly. Got the custom IIFE idea from Max Shawabkeh (https://stackoverflow.com/users/181765/max-shawabkeh) on Stack Overflow: https://stackoverflow.com/questions/2303147/injecting-js-functions-into-the-page-from-a-greasemonkey-script-on-chrome/2303228#2303228 This is working now, but I want a way to build the final user script without copy-pasting the imports in the main file. Going to work out the build rules next.
2021-03-21Build into a Greasemonkey user scriptTeddy Wing
Add Browserify to enable imports. Remove the script insertion code since it isn't necessary for a user script.
2021-03-20Relicense under the GNU GPLv3+Teddy Wing
2015-05-24Inject peniquitous.js into the page contextTeddy Wing
Instead of handling the keyboard events in the content script, inject a script onto the page that does the key listening and simulating. This allows the simulation of up & down arrow key presses to actually trigger the proper page event listeners and allow our custom code to do the right thing instead of firing a key event in the Chrome extension's isolated environment and not having anything happening because no listeners are attached in the isolated environment. Also inject the `KeyEvent` object from Mousetrap so we can use it's key simulation feature. Will likely want to extract that into our own custom code so we're not including a whole script that we only use 20% of or so.