aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-05-24README.md: Add demo gifv0.0.1Teddy Wing
Show people what's going on and how to use the extension.
2015-05-24Add README.mdTeddy Wing
* Description * Installation notes * License information
2015-05-24Add LICENSETeddy Wing
MIT license.
2015-05-24peniquitous.js: Target "search"-type inputsTeddy Wing
Apparently Wikipedia uses `input[type="search"]`. Might as well include it since that's probably a common type of input for this use case.
2015-05-24peniquitous.js: Get rid of key code magic numbersTeddy Wing
Move the key code numerical values into a hash so we can refer to them by name instead of obtuse magic numbers.
2015-05-24peniquitous.js: Get rid of test codeTeddy Wing
This was used to test out simulating a down arrow key press on the Google search home page with the field selected and something typed in. If the first entry in the suggestion drop-down was selected after the timeout fired, that means it worked. We no longer need this test code.
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.
2015-05-24peniquitous.js: Try to listen for & simulate key eventsTeddy Wing
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.
2015-05-23Add peniquitous.js, bind to input focus (WIP)Teddy Wing
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.
2015-05-23Set up Bower. Install Mousetrap.Teddy Wing
* Create limited bower.json file * Create .bowerrc that tells Bower to use the `lib` directory * Install Mousetrap for key events
2015-05-23manifest.json: Fix `content_scripts` script definition syntaxTeddy Wing
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".
2015-05-23manifest.json: Fix `content_scripts` syntaxTeddy Wing
Apparently it takes an array not a hash.
2015-05-23manifest.json: Change name "Peniquity" to "Peniquitous"Teddy Wing
I like the sound of the '-ous' better.
2015-05-23Initial commitTeddy Wing
Test manifest.json copied and modified from another one of my extensions. A decent start.