aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
AgeCommit message (Collapse)Author
2016-03-09Fix mainFrame command...Stephen Blott
Oversight from #2022.
2016-03-06Fix focus issue with UI components.Stephen Blott
Problem: - `?`, `o`, `Esc`, `Esc` leaves the focus in the (invisible) help dialog frame, rendering Vimium broken. Since we do @iframeElement.focus() when we activate a UI component, here we do @iframeElement.blur() when hiding such elements. Fixes #2038.
2016-03-06Don't HUD.init() until DOM is ready.Stephen Blott
2016-03-06Do no init Vomnibar pre-DomReady (tweak).Stephen Blott
2016-03-06Do no init Vomnibar pre-DomReady.Stephen Blott
2016-03-06Address possible race condition in Vomnibar initialization.Stephen Blott
This addresses the potential race condition mentioned in this commit record (3542db7b6c322d803c263db641ae0b02327447ca) and in #2033. In non-top frames, wait until documentReady before sending the message to initialise the Vomnibar. This cannot be before preDomReady in the main frame, right?
2016-03-06Initialize UI components only when they're needed.Stephen Blott
HUD: Initialize only when the frame receives the focus and Vimium is enabled. Vomnibar: Initialize in the top frame when Vimium is enabled in *any* frame. Warning: There may be a race condition here. Specifically, if Vimium is disabled in the main/top frame (T) but enabled in another frame (A), then the initialisation could happen in frame A before frame T is listening, so frame T would miss the initialization message (which is only sent once). Message listeners are installed early (and probably installed first in the main/top frame), and the `isEnabledForUrl` messaging takes some time, so perhaps it's OK. But it *is* a race condition. Fixes #1838.
2016-03-06Make HUD.init() idempotent.Stephen Blott
2016-03-06Fix count handling (again).Stephen Blott
`7gj` should be `1j`. Also, with: map ab SOMETHING `7aab` should be `1ab`. Replacement for 7774beb6643c0d905f9caba4345453790af948ad.
2016-03-06Revert "Count prefix applies only to leading mapping."Stephen Blott
This reverts commit 7774beb6643c0d905f9caba4345453790af948ad. Reverting this. It can be done better (and capture some other incorrect cases).
2016-03-06Normal mode tests.Stephen Blott
With #2022, we can now implement normal-mode key-handling tests. Writing these tests uncovered the bug behind 7774beb6643c0d905f9caba4345453790af948ad.
2016-03-06Count prefix applies only to leading mapping.Stephen Blott
E.g. `7gj` should be `1j`; currently it's `7j`.
2016-03-05Move LinkHint mode indicator text into modesmrmr1993
2016-03-05Tweak #2036.Stephen Blott
2016-03-05Use clickModifiers in link hint modes for modifiers for click activationmrmr1993
2016-03-05Move non-click link hint activators to the corresponding mode objectsmrmr1993
2016-03-05Factor out click activators in link hintsmrmr1993
2016-03-05Reformat link hint mode objects for easier diffsmrmr1993
This is a no-op.
2016-03-05Generalise topFrame commands.Stephen Blott
This generalises the mechanism by which commands are always run in the tab's main/top frame. Currently, that's just the Vomnibar. This is a precursor to moving other UI components to the main/top frame. It should be fairly trivial to move the help page to the main frame. The HUD might be trickier. Mention: @mrmr1993.
2016-03-05Simplify command-registry generation.Stephen Blott
If we just use the name `background` instead of `isBackgroundCommand`, then we can simplify the building of registry entries. This is preparitory to adding a new registryEntry field: topFrame; initially just for the Vomnibar, but thereafter for other UI components.
2016-03-05Key bindings; disable on disconnect.Stephen Blott
This reinstates the feature whereby we disable the content script when we lose contact with the background page, e.g., on upgrade. From my investigations, this doesn't appear to be absolutely necessary. Nevertheless, it's cleaner like this.
2016-03-05Key bindings; reset on passKeys change.Stephen Blott
Normal mode updates the pass keys every time the frame changes (so, also every time we change tab). Here, we reset the key state too. Resetting the key state makes sense when, for example, the user has changed the pass keys. However, it also changes a status quo/master behaviour: - `g`, change-tab-with-mouse, change-back, `g` -- previously this scrolled to top; now it does not.
2016-03-05Key bindings; do not reset on passKeys change.Stephen Blott
This reinstates the legacy behaviour in the following case: - `g` - change tab - change back to the original tab - `g` - ..... which scrolls to top. It is not obvious that this is the best behaviour, but it is the legacy behaviour, and it certainly isn't unreasonable.
2016-03-05Key bindings; miscellaneous...Stephen Blott
- remove unused "event" parameter - move methods around to put like with like - simplify some expressions - one better method name
2016-03-05Key bindings; simplify pass-key logic.Stephen Blott
2016-03-05Key bindings; and yet more tiny tweaks.Stephen Blott
2016-03-05Key bindings; move Vomnibar commands back to content scripts.Stephen Blott
2016-03-05Key bindings; more small tweaks.Stephen Blott
2016-03-05Key bindings; small tweaks...Stephen Blott
- simplify pass key condition - don't keep key-parsing Regexp in memory - we should reset the key state when the pass keys change
2016-03-05Key bindings; and yet more tweaks.Stephen Blott
2016-03-05Key bindings; refactor passKeys distribution.Stephen Blott
It makes more sense to pass the passKeys directly to normalMode. So, do so, and remove the trackState mode option - which isn't otherwise being used.
2016-03-05Key bindings; tweaks.Stephen Blott
2016-03-05Key bindings; refactor passKeys.Stephen Blott
Previously, the key-handling logic (keyQueue, etc) was and the backend whereas passKeys were handled in the content scripts - so they were a long way apart. Now that they're in the same place, it makes more sense to integrate passKey handling into the regular key handling, because they depend upon the same data structures.
2016-03-05Key bindings; tweaks.Stephen Blott
2016-03-05Key bindings; and yet more minor tweaks.Stephen Blott
2016-03-05Key bindings; yet more minor tweaks.Stephen Blott
2016-03-05Key bindings; fix tests...Stephen Blott
... and fix two bugs: - not suppressing keyup event after keyChar matched in keydown. - we cannot check the passKeys keyChar in keyup because the key state has changed; so we track what the next keyup response should be.
2016-03-05Key bindings; more minor tweaks.Stephen Blott
2016-03-05Key bindings; minor tweaks.Stephen Blott
2016-03-05Key bindings; more tweaks and fixes.Stephen Blott
Miscellaneous fixes and tweaks, including: - Reinstate key logging. - Fix count handling in line with expected behaviour in #2024. - Remove `noCount` option; we don't need it. - Simplify logic in various places. Fixes #2024.
2016-03-05Key bindings; tweaks and fixes.Stephen Blott
2016-03-05Key bindings; rewire vomnibar (tweaked).Stephen Blott
2016-03-05Key bindings; rewire vomnibar.Stephen Blott
2016-03-05Key bindings; remove legacy code.Stephen Blott
2016-03-05Key bindings; fix passkeys.Stephen Blott
2016-03-05Key bindings; partially functioning w/ backgound commands.Stephen Blott
2016-03-05Key bindings; initial partially-functioning version.Stephen Blott
2016-03-05Key bindings; initial "generic" class.Stephen Blott
This implements a generic front-end class for key handling (a la normal mode). Also: - supports count prefixes (or not) - supports multi-key mappings (longer than two) Also included is a very poor-man's demo. See the bottom of mode_key_handler.coffee for some hard-wired key bindings. IMPORTANT: This does not actually work as Vimium. It's just a demo.
2016-03-05Improved test for messages intended for background page.Stephen Blott
The options page receives messages intended for the background page (and we're getting console warnings). This is a more general test for when the front end should ignore such messages. Fixes #2034.
2016-03-04Merge pull request #2029 from smblott-github/refactor-link-hintsStephen Blott
A small refactor link hints.