aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
AgeCommit message (Collapse)Author
2016-03-18This isn't needed any more.Stephen Blott
2016-03-18Reduce complexity for initialising the top frame.Stephen Blott
In #2053, I omitted to notice that the top-frame (vomnibar) initialisation sequence also generates O(n^2) messages. This makes that sequence O(n).
2016-03-18Refactor mode initialisation for clarity.Stephen Blott
2016-03-18Clarify why things are exported.Stephen Blott
We have: window.XXX = XXX = -> ... in many places. This commit reduces the number of these, and moves the exports to the end, where a single comment explains why they're being exported.
2016-03-18Refactor the front-end initialisation sequence.Stephen Blott
The front-end initialisation sequence has become quite confused. This simplifies it, makes things which must be idemtpotent explicit and renames some functions to make it clear when they run. It also avoids a situation where we were possibly installing a `domReady` function to initialise the HUD multiple times. Should be a no-op functionality wise.
2016-03-17Logging; consistent and concise normal-mode logging.Stephen Blott
2016-03-17Minor refactoring.Stephen Blott
2016-03-17Refactor setIcon to the background page.Stephen Blott
There's no need for the setting of the icon to be driven from the content script. We first know the enabled state in the background page, so set the icon there immediately.
2016-03-17Minor refactoring.Stephen Blott
This tidies up some logic that was showing its age.
2016-03-17More tweaks for #2053.Stephen Blott
2016-03-17Tweaks for #2053.Stephen Blott
2016-03-17Simplify domReady handling.Stephen Blott
2016-03-17Tweaks.Stephen Blott
2016-03-17No need to block until `frameId?`.Stephen Blott
Now that we've moved Frame.init() back to before checkIfEnabledForUrl, there's no longer a need to check that frameId has been initialised. It must have been.
2016-03-17Move isEnabledForUrl to Frame.port.Stephen Blott
2016-03-17Open frames port pre documentReady.Stephen Blott
The intention is to move checkIfEnabledForUrl to the frames port. That needs to run pre domReady, so first -- here -- we separate the two ports.
2016-03-17Use Chrome frameIds.Stephen Blott
2016-03-17Use ports to track frames.Stephen Blott
Use `onConnect()`, the `domReady` port and `onDisconnect()` to track the frames within a tab.
2016-03-16Relocate first scrollable element.Stephen Blott
When the scrollers `activatedElement` isn't scrollable, we currently search up the DOM tree for the next scrollable thing, and stop at `document.body`. However, it can be that that isn't scrollable. When that happens, this commit searches for a scrollable element in the same way as it does when the frame initially loads. This makes it possible to restart scrolling on pages like this one: - http://redux.js.org/docs/basics/UsageWithReact.html after clicking one of index links. Inspired by example posted by @marlun in #425.
2016-03-10Tests; add alphabet-hint hint tests.Stephen Blott
This adds tests for a couple of properties that are required of alphabet hint strings.
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