Age | Commit message (Collapse) | Author |
|
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.
|
|
Instead of copy-pasting the code from the files directly into main.js,
do it in the build recipes.
|
|
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.
|
|
Add Browserify to enable imports. Remove the script insertion code since
it isn't necessary for a user script.
|
|
|
|
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.
|