Age | Commit message (Collapse) | Author |
|
Doesn't quite work. We're correctly listening for Ctrl-N/P presses, and
seemingly correctly simulating corresponding up/down key presses, but it
seems that the 'content scripts' can't trigger page events.
See
https://developer.chrome.com/extensions/content_scripts#execution-environment
which describes the "isolated" execution environment of Chrome content
scripts.
Spent a while trying to figure out why this wasn't working. Finally
looked back through my Chrome console history and found out what I did
previously to get it working and it turns out that was the same thing
I'm doing here. Finally had a moment of inspiration that prompted me to
look into the different execution environment thing.
Found a useful Stack Overflow post that descibes how to inject a script
onto the page, which will give me access to the page's context:
http://stackoverflow.com/questions/9515704/building-a-chrome-extension-inject-code-in-a-page-using-a-content-script
Doing that should get this working, so that's what I'm going to try
next.
|
|
Work in progress.
Get all inputs on the page. Bind a callback to their focus event. The
intention is that when the input is focused, I attach a handler to
listen for Ctrl-N/P presses.
Now that I'm writing this and thinking about it though, I might as well
just bind the Ctrl-N/P listeners to all inputs to begin with an be done
with it. Kind of a brute-force way of dealing with it but then I
wouldn't have to keep track of whether or not I've bound those listeners
to an input that was already focused previously.
|
|
* Create limited bower.json file
* Create .bowerrc that tells Bower to use the `lib` directory
* Install Mousetrap for key events
|
|
The scripts need to be defined in the "js" key. All these syntax errors
are because this block used to be a "background" definition but I
changed it to "content_scripts".
|
|
Apparently it takes an array not a hash.
|
|
I like the sound of the '-ous' better.
|
|
Test manifest.json copied and modified from another one of my
extensions. A decent start.
|