aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
AgeCommit message (Collapse)Author
2017-04-22Fix global marks.Stephen Blott
This is a follow up to the move to using keydown for all events, and fixes a bug I introduced. Specifically, we were reacting to the first keydown event, which could be just the `Shift` key.
2017-04-22Refactor getSelectionType() to DOM utils.Stephen Blott
This is a no-op. It is preparatory to implementing a suitable polyfill for `selection.type` for Firefox.
2017-04-22Revert "Firefox: Fix visual mode."Stephen Blott
This reverts commit 50b117733c4f0ecf9fd507c28d2f2967b5b1404b. Reverting this. In response to comments from @mrmr1993, this is not the best way of achieving what's required.
2017-04-21Firefox: Fix visual mode.Stephen Blott
The problem with visual mode is that `@selection.type` isn't implemented in Firefox/Gecko. Here, we simulate the same effect with `anchorNode` and the length of the selection. Mention @mrmr1993.
2017-04-21Fix tab for link-hint selection.Stephen Blott
We were leaking the keydown event to the page when using TAB to select link hints (filtered hints).
2017-04-20Blur the focused iframe when restoring window focusmrmr1993
This works around FF issue 554039, which prevents window.top.focus() from working.
2017-04-18Fix <Shift> or <Ctrl> link-hint behaviour.Stephen Blott
Error was introduced by seemingly innocuous but nevertheless significant change in previous commit. Tests picked up the problem.
2017-04-18Fix filtered link hints.Stephen Blott
For filtered link hints, " " was broken; it was treated as "space".
2017-04-18Use event.code to detect/suppress keyup events.Stephen Blott
This avoids the possibility of leaking keyup events if the keys a released in a different order from that in which they were pressed. Also, replace suppressKeyupAfterEscape with this same mechanism. This fixes a bug (in master/1.59) whereby we leak the keyup event for `i` when entering insert mode. TODO: - `/`, `<Escape>` leaks a keyup event - `i` leaks a keyup event
2017-04-18Continue bubbling unmapped events.Stephen Blott
2017-04-18Do not reset key state for modifiers.Stephen Blott
2017-04-18Avoid repeating Backspace and Delete keys.Stephen Blott
2017-04-18Remove use of keyCodes entirely.Stephen Blott
event.keyCode` is depricated: - https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
2017-04-18Rework tests for all key handling on keydown.Stephen Blott
2017-04-18Remove out-of-date comment.Stephen Blott
2017-04-18Migrate marks to keydown only.Stephen Blott
2017-04-18Migrate link hints to keydown only.Stephen Blott
2017-04-18Move keyboard utils to keydown and migrate normal/visual modes.Stephen Blott
2017-04-17Clarify postFindFocus and obviously separate it from the try..catchmrmr1993
2017-04-16Rework FindMode HUD refocusing to not depend directly on the HUDmrmr1993
2017-04-16Catch errors thrown by window.find when it wraps/fails on FFmrmr1993
This does NOT fix wrapping, only catches errors
2017-04-16Fallback to storage.local if storage.sync is not availablemrmr1993
2017-03-26fix typoLuke
2017-03-22Remove and refactor mapKeyRegistery.Stephen Blott
1. Remove the use of mapKeyRegistery from the mode handler. 2. Refactor use of mapKeyRegistery keyboard utils. This is preparatory to refactoring all of the keyboard handling.
2017-03-10Use the appropriate handler for hashChangemrmr1993
2017-03-09Fix #2445 (link hints with queue broken).Stephen Blott
2017-03-04Merge pull request #2384 from gdh1995/pass-keys-on-body-lockedStephen Blott
InsertMode should not handle key events if document.body is editable
2017-02-11Don't depend on global event for Frame event listeners (FF)mrmr1993
2017-02-11Don't depend on global event for CoreScroller event listeners (FF)mrmr1993
2017-02-08Stop using non-standard event.srcElement; switch to event.targetmrmr1993
2017-01-03InsertMode should not handle key events if document.body is editablegdh1995
For example, the host JavaScript may create an "about:blank" iframe with a `content-editable` `body`, and then: * the parent frame may handle `Escape` key events by itself * but now, Vimium always grabs `Escape` events * and tries to exit `InsertMode` * although `document.body` is still current `activeElement` after `body.blur()` * as a result, neither the parent can receive and handle wanted keyevents, nor Vimium will succeed in returing back to NormalMode
2016-12-26Fix (another) infinite-scroll issue.Stephen Blott
Steps to reproduce: - Press and hold `j`. - Tab `k`. - Release `j`. The tap on `k` is uninstalling the `cancelEventListener` installed by `j`, and because we advance `@time`, the `j` stops scrolling and removes the `cancelEventListener` installed for `k`. So we end up with no `cancelEventListener` installed. The fix is to make the `cancelEventListener` specific to the scroller instance. The more fundamental problem here is that we're mixing dynamic and static state. A better approach would be to have `CoreScroller` as a class, with a new instance created for each scroll instance.
2016-12-26Guard against element.tagName not being a string.Stephen Blott
Example page: http://codeforces.com/contest/752/problem/B. There, `element.tagName` is an element with `name` `tagName` (not a string). Here, we guard against that case. Fixes #2305.
2016-12-21Don't focus non-focusable node.Stephen Blott
Try the following.... - load page - `/` - type some junk which matches nothing - `Escape` We expect to leave find mode. Instead, we have to hit escape again to get out of find mode. Here, `focusNode.focus()` is not a function.
2016-12-21Tweak #2327.Stephen Blott
2016-12-21Merge pull request #2311 from smblott-github/enterNormalModeStephen Blott
New command option to enter normal mode
2016-12-21Merge pull request #2327 from sco-tt/capitalized-link-hints-options-2Stephen Blott
Makes sure all custom link hint characters defined in settings are lowercase
2016-12-12Remove unused parameter.Stephen Blott
2016-12-11Rework help-dialog HTML.Stephen Blott
Previously, the dynamic HTML for the help dialog was generated on the background page. The HTML itself was tangled in with program logic. Here, we move all of the HTML to HTML5 templates; also, we build the help-dialog contents in the help dialog itself, not on the background page. Note: #2368 is included here too. (Background: I'm trying to clean up some of the command and help-dialog logic in preparation for addressing the issue of how to document command options, see #2319.)
2016-12-10Merge pull request #2326 from smblott-github/move-search-engines-to-bg-utilsStephen Blott
Move SearchEngines to bg-utils.coffee.
2016-12-10Use 'map X passNextKey normal'.Stephen Blott
2016-11-09treat select element as an input, setting focus to itRamiro Araujo
2016-10-23Makes sure all custom link hint characters defined in settings are lower ↵Scott Pinkelman
case when link hints are generated
2016-10-23Move SearchEngines to bg-utils.coffee.Stephen Blott
`SearchEngines` was previously in `utils.coffee`, which means it was loaded in *every* content frame. This is unnecessary, since it is only used on the background page. So this PR moves it there. Also: - Simplify some unnecessarily complex logic in `vomnibar.coffee`. - Re-use `Utils.parseLines()` to parse the custom search engine configuation text.
2016-10-15enterNormalMode; tweak indicator.Stephen Blott
2016-10-15enterNormalMode; new command - implementationStephen Blott
Here's the problem... Many sites define their own keyboard shortcuts, for example Google Play Music defines `gh` for "go home". On such sites, it's natural to set up pass keys for `g` and `h`. But that makes any Vimium key bindings which begin with `g` inaccessible. Here, we add a new command `enterNormalMode` which installs a new normal-mode instance (without any pass keys). This executes a single normal-mode command then exits. Example: map \ enterNormalMode map | enterNormalMode count=999999 Assuming `g` and `o` are pass keys: - `gh` or `o` - use the page's binding - `\gg` - scroll to top - `2\ggo` - scroll to the top and open the Vomnibar - `\g<Escape>o` - open the Vomnibar - `\<Escape>o` - use the page's bindings - `\\\\\\<Escape>o` - use the page's bindings (new normal-mode instances displace previous ones) This required some changes to the scroller. Previously, we only ever had one normal-mode instance, and could arrange statically that the scroller's key listeners were above normal-mode's key listeners in the handler stack. Here, we fix this by adding and removing the scroller's listeners dynamically, so they're always at the top of the handler stack.
2016-10-15No-op; rearrange content-script command arguments.Stephen Blott
This is a no-op. It arranges that the registry entry for each command is passed to the command, for every command. That required a small ammount of reworking in a couple of cases.
2016-10-10Merge pull request #2306 from smblott-github/add-key-translationStephen Blott
Add "mapkey" command for key mappings.
2016-10-10Rename 'translate' to 'mapkey'.Stephen Blott
2016-10-10Disable grab-back-focus in all frames.Stephen Blott
When the user begins interacting with one frame, we disable the grab-back-focus mode in *all* frames. Previously, grab-back-focus was preventing users from selecting inputs in frames other than the active frame. Fixes #2296 (possibly).