aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-04-02Do not register tiny frames.Stephen Blott
This affects focusFrame and link hints. We do not register tiny frames. The reason for doing this is that link hints messages all (registered) frames to collect their hint descriptors. On some sites (e.g. Google Inbox and other Google properties), there are many tiny iframes (on the order of 12 or 15 or so). Those frames cannot provide useful hints, so -- by not registering them -- we don't ask them for hints. The intention is to speed up the link-hints activation sequence.
2016-04-02Move the test for small windows to DomUtils.Stephen Blott
The reason for doing this is that we will be using the same test to decide whether or not to register a frame.
2016-04-02Separate registerFrame from port initialization.Stephen Blott
This is a no-op. It separates the process of registering a frame with the background page from the port initialization. The idea is that -- soon -- we will only register some frames; in particular, we should not register the many tiny iframes on pages like GMail. The eventual goal is to speed up the global link-hints initialisation sequence.
2016-04-02The name argument isn't being used here.Stephen Blott
2016-04-02Use ports for all link-hint messages.Stephen Blott
This seems to be considerably faster than using sendMessage().
2016-04-02Use port for frame-to-background messages.Stephen Blott
Without considering the size of the data passed, ports seem to be about 5 times fast than sendMessage(), so we use ports of link-hint messages wherever possible.
2016-04-02Wait for docomentReady to generate hints.Stephen Blott
If document.documentElement isn't ready, then we can'r generate hints. Moreover, this would crash -- thereby hanging global link hints.
2016-04-02topFramePortForTab is no longer needed.Stephen Blott
We use portsForTab[0] instead.
2016-04-01Maintain portsForTab mapping tabIds to frame ports.Stephen Blott
This maintains a mapping from tab Ids to a mapping from frame Ids to their ports.
2016-04-01Tweak hel dialog height.Stephen Blott
2016-04-01Fix height of help dialog.Stephen Blott
Following on from f0911e52f0e71c6d2539bdc74a09ff2dbd5ab125, I omitted to verify that the height of the dialog was correct on taller screens.
2016-04-01Ensure settings are loaded.Stephen Blott
With global link hints, hints might be launched in one frame when the settings are not yet loaded in another. This could lead to one frame using one settings value, and another another value. (Because we use the default value if the settings are not yet loaded.) And this in turn could cause link hints to crash if filetered hints are used (because, in that case, we would not calculate hint.linkText in one frame, but then try to use that value later in another frame).
2016-04-01Tweak Settings to add onLoaded() method.Stephen Blott
Settings.onLoaded() is similar to Settings.use(), except it does not require/expect a key argument. Would could simulate .onLoaded() with .use() by artificially adding an (unused) key, but that would make the code less clear. So it seems better to have a separate method.
2016-03-31Merge pull request #2079 from smblott-github/rename-handlerStack-constants-v3Stephen Blott
Rename handler stack constants, and rework logic for greater clarity
2016-03-31Fix @suppressEvent and tweak comments.Stephen Blott
2016-03-31Use @suppressEvent instead of false.Stephen Blott
2016-03-30Rework handlerStack.bubbleEvent() for greater clarity.Stephen Blott
2016-03-30Tweak 21da3fcafbb29540788037dbcdbdce79ad14e650.Stephen Blott
2016-03-30Rename handlerStack constants.Stephen Blott
Problems: - The meanings of some of the Mode/handlerStack constant names is far from obvious. - The same thing is named different things in different places. This changes various constant names such that: - the names used in the handler stack and in the modes are the same. - ditto vis-a-vis DomUtils. Also, break out the core of the handler stacks' `bubbleEvent` method into a switch statements. This makes it more obvious that the cases are mutually exclusive.
2016-03-30Add tests for GrabBackFocus.Stephen Blott
2016-03-30Add test for SuppressAllKeyboardEvents.Stephen Blott
Which: - uncovered a typo in 39adee9090fc5aadfd5dd681f91b80025084858a. Also: - make Mode.debug a class variable, which is more helpful while trying to debug. Specifically, you can turn debugging on or off from within the tests, for example.
2016-03-30Fix link-hints race condition.Stephen Blott
Because there is a small amount of time between link-hints mode being requested and it being activated, it was possible to launch other Vimium commands (e.g. the Vomnibar) after requesting link-hints mode, and before link-hints mode starts. This prevents that.
2016-03-30Minor refactor of link-hints exit sequence.Stephen Blott
The exit sequence is clearer like this.
2016-03-29Fix typo in debugging code.Stephen Blott
2016-03-29Fix race condition in grab-back-focus.Stephen Blott
See the newly-added comment.
2016-03-29Add tests for WaitForEnter.Stephen Blott
2016-03-29Ensure window has focus in tests.Stephen Blott
2016-03-29Escape to exit WaitForEnter.Stephen Blott
Context: filtered link hints with wait-for-enter enabled. Once a link is selected, it is highlighted. We then consume all keyboard events until the user hits enter, at which point the link is activated. Problem: When we're waiting, the link is highlighted. It looks to the user like `Escape` should cancel. This implements escape to cancel at that point in the exit sequence.
2016-03-28Disable Ctrl modifier for filtered hints.Stephen Blott
2016-03-28Merge pull request #2070 from smblott-github/icon-use-image-dataStephen Blott
Use image data for icons.
2016-03-28Use image data for icons.Stephen Blott
This uses image data (instead of a path) for the page icon. It also only builds 19x19 and 38x38 icons, as per the chrome.browserAction.setIcon() documentation. This appears to fix a memory leak related to a recent Chrome regression (versions 49+). Fixes #2055.
2016-03-28Update README.md for recent changes.Stephen Blott
2016-03-28Change hintMarkers to @hintMarkers.Stephen Blott
hintMarkers was previously passed around (within the link-hints mode class) from function to function. With #2048 (global link hints), it is better if this becomes @hintMarkers (that is, is available directly to all methods within the class. With #2048, we used bind to avoid having to do this - to keep the diff clearer. Here, we do it directly.
2016-03-28Better names for variables.Stephen Blott
These variable names are misleading. The things being manipulated are actually hint descriptors. So this renames the variables accordingly.
2016-03-28Move LocalHints out of link-hints mode.Stephen Blott
This code (LocalHints) has been embedded into the middle of the link-hints mode class. And it shouldn't be. This moves it out, and allows us to unwind some of the gymnastics #2048 (global link hints) introduced to avoid having an incomprehensible diff.
2016-03-28Merge pull request #2069 from smblott-github/global-link-hints-++Stephen Blott
Link hints: false positives and scrollable divs
2016-03-28Better test for scrollability.Stephen Blott
Testing the `scrollHeight` is cheaper than testing scrollability. There are a lot of non-scrollabile divs, so it makes sense to use this cheaper test as a filter.
2016-03-28Fix for f6925630a7e22b4483bc872d9242776bce5337c1.Stephen Blott
We should start by checking the *parent* of the candidate descendant.
2016-03-28Filter out link-hint false positives.Stephen Blott
We recognise elements with a class names containing the text "button" as clickable. However, often they're not, they're just wrapping a clickable thing, like a real button. Here, we filter out such false positives. This has two effects: - It eliminates quite a number of real false pasitives in practice. - With fewer hints close together, fewer hint markers are obscured by the hints from (non-clickable) wrappers. This reduces the need for rotating the hint stacking order, e.g #1252.
2016-03-28Make scrollable elements selectable with hints.Stephen Blott
Fixes #425. Conflicts: content_scripts/scroller.coffee
2016-03-28Merge pull request #2048 from smblott-github/global-link-hintsStephen Blott
Global link hints
2016-03-28Global link hints; fix tests after rebase.Stephen Blott
2016-03-28Global link hints; make frames selectable.Stephen Blott
2016-03-28Global link hints; self code review (3)...Stephen Blott
... Also, do not set an active hint marker initially (because it's not predicatble which hint will be selected).
2016-03-28Global link hints; revert b7535a604954b5873d825eb66bfecd08f1f2c99b.Stephen Blott
Here's why: - b7535a604954b5873d825eb66bfecd08f1f2c99b is complicated and complex (O(n^2)). - With experience, it is not obviously better than what was there before, and in some cases it's worse. - b7535a604954b5873d825eb66bfecd08f1f2c99b selects way too much text in some cases; e.g. on Google Inbox, it selects text lengths in the tens of thousands of characters. That cannot be useful. - With global hints, this extra cost (resulting from passing large objects between frames) is significant and noticable. - The simpler approach of accounting for text length when scoring filtered hints (tweaked here: 5cbc5ad702a01a81b98f8c82edb3b6d227c2c7b5) works better in practice.
2016-03-28Global link hints; self code review (minor tweaks).Stephen Blott
Just tweaks.
2016-03-28Global link hints; self code review.Stephen Blott
- Better comments in places. - Better variable and message names in some places.
2016-03-28Global link hints; better comments, exit() fix.Stephen Blott
2016-03-28Global link hints; focus window for selectable elements.Stephen Blott
Because we're running hint modes in multiple frames, we need to ensure the right frame has the focus for selectable elements (inputs).
2016-03-28Global link hints; do not exit in Esc here.Stephen Blott