aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-03-21Move userscript-header.txt into main.js.inHEADv0.1.0masterTeddy Wing
We're not including anything above `main.js.in`, so the top of that file always ends up as the top of the final user script. We don't need a separate build step to include it.
2021-03-21Makefile: Ensure Mousetrap license is commentedTeddy Wing
Forgot to comment out the Mousetrap license in the final build file.
2021-03-21main.js.in: Remove old `console.log`Teddy Wing
This was for debugging and is no longer needed.
2021-03-21README: Change Chrome extension references to user scriptTeddy Wing
2021-03-21Add CHANGELOGTeddy Wing
2021-03-21Increase version v0.0.1 -> v0.1.0Teddy Wing
2021-03-21Remove manifest.jsonTeddy Wing
This is no longer needed now that Peniquitous is a Greasemonkey user script.
2021-03-21Remove Bower-included MousetrapTeddy Wing
Now that we've added Mousetrap via NPM, we can remove the one we installed via Bower and Bower files. Didn't really need to switch to NPM, but I wanted to get a Mousetrap dependency that included its LICENSE file so I could include it in my build.
2021-03-21peniquitous.user.js: Add Mousetrap license to key-event codeTeddy Wing
2021-03-21Makefile: Use NPM MousetrapTeddy Wing
2021-03-21Add 'mousetrap' via NPMTeddy Wing
This will give me access to Mousetrap's LICENSE file.
2021-03-21main.js.in: Remove old script insertion codeTeddy Wing
Remove the old Chrome extension code now that it works as a user script.
2021-03-21Makefile: Add a new `peniquitous.user.js` targetTeddy Wing
Don't need Browserify. Just concatenate the user script header and the compiled `main.js`. Rebuild the `peniquitous.user.js` user script file.
2021-03-21peniquitous.js: Add missing `var` declarationTeddy Wing
Make this a local instead of a global variable. Must have forgotten the `var` when I first wrote this.
2021-03-21Remove BrowserifyTeddy Wing
We're no longer using the `require` imports to include JS files. Instead we have a template string process. Not as robust, but easier to fit what the final user script needs to be.
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-21Makefile: Try concatenating instead of BrowserifyTeddy Wing
The keyboard event simulation didn't work. Tried getting rid of Browserify and including the JS all in one file, but that didn't make a difference. Committing this for reference.
2021-03-21Add user script headerTeddy Wing
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-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.