aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
AgeCommit message (Collapse)Author
2016-04-26Help dialog; consistent ordering of commands.Stephen Blott
It reads weird on the helpd dialog if we don't put the full-page and half-page commands in a similar order.
2016-04-26Help dialog; re-order and tweak command descriptions.Stephen Blott
- Re-order commands such that we keep like with like, and have the more important commands nearer the top. - Re-word some command descriptions such that we use the same words for the the same thing consistently. - Move "View Source" to the "Miscellaneous" category. - Make some commands "advanced commands".
2016-04-25Help dialog; fix show-advanced-command button position.Stephen Blott
2016-04-23Show tip re. clicking command names.Stephen Blott
It's pretty undiscoverable that you can click command names to yank them. So, this adds a tip to the bottom of the help dialog. Also, change the cursor to a pointer when hovering over command names.
2016-04-22Nicer styling of command names in help dialog.Stephen Blott
The commands names (in the help dialog) look nicer in italics. They also format better that way.
2016-04-22Help dialog; do not offer hints outside of the help dialog.Stephen Blott
2016-04-22Help dialog; better formatting of command names.Stephen Blott
This needs more work.
2016-04-22Help dialog: put keys in greyed-out box.Stephen Blott
2016-04-22Help dialog: increase size and make white background.Stephen Blott
2016-04-18Cache content_scripts/vimium.css in chrome.storage.local.Stephen Blott
Previously, we had two different approaches. This seems like a simpler approach. We simply cache the Vimium CSS in chrome.storage.local (in the background page) and fetch it from there (in UI components). There is also a minor change in the we no longer cache the CSS in memory. This seems to be the right thing to do. Caching the CSS in memory consumes a small amount of memory. However, it can only speed up the fastest loads. It cannot speed up the first load -- which is likely the one that matters most. So caching the CSS in memory seems to make little sense.
2016-04-18Revert "Cache content_scripts/vimium.css in chrome.storage.local."Stephen Blott
This reverts commit 0a49cc45732175c65651b5f054c677d6c42a28c0.
2016-04-18Cache content_scripts/vimium.css in chrome.storage.local.Stephen Blott
Previously, we had two different approaches. This seems like a simpler approach. We simply cache the Vimium CSS in chrome.storage.local (in the background page) and fetch it from there (in UI components). There is also a minor change in the we no longer cache the CSS in memory. This seems to be the right thing to do. Caching the CSS in memory consumes a small amount of memory. However, it can only speed up the fastest loads. It cannot speed up the first load -- which is likely the one that matters most. So caching the CSS in memory seems to make little sense.
2016-04-17Make showHelp a top-frame command.Stephen Blott
Replaces #2037.
2016-04-17Make showHelp not a background command.Stephen Blott
2016-04-17There's no need for a new suggestion property...Stephen Blott
We do not need "displayUrl", we can re-use "shortUrl" instead. It does what we need already.
2016-04-17Do not deduplicate javascript: URLs.Stephen Blott
2016-04-17For javascript URLs, do not match javascript content.Stephen Blott
We only match the text "javascript:...". The affects only the bookmark completer.
2016-04-09Simplify javascript: URLs in vomnibar.Stephen Blott
Show "javascript:" URLs as "javascript:...". Fixes #961.
2016-04-08Reinstate necessary test.Stephen Blott
Reinstate test removed incorrectly in d1c230cabb051a5429242c98e67d37b65edc58b8.
2016-04-08Do not post hint descriptors back to the frame itself.Stephen Blott
When distributing hint descriptors, do not post a frame's own hint descriptors back to the frame itself. It already has them. With regard to the message-passing cost only, this represents a speedup of approximately 3/2 for link-busy sites like reddit -- several tens of milliseconds for me. There are other costs too (such as processing the hint descriptors) bu these are not affected.
2016-04-05Frame Ids must be integers.Stephen Blott
2016-04-05Unregister frame when postMessage fails.Stephen Blott
2016-04-05Better close-down for global link hints.Stephen Blott
- Unregister frames with the background-page hint coordinator. - Better page cleanup in the content scripts. - Require documentReady before harvesting hints. There is still an issue in some cases when link-hints are activated as a page is transitioning, but that problem case seems to have existed in 1.54. I'll continue to investigate.
2016-04-05Unregister frame on "unload".Stephen Blott
It seems we cannot rely on the port being disconnected to unregister a frame. So we need to unregister it on "unload".
2016-04-04Only send required link-hint properties.Stephen Blott
There's other stuff (ports, frameIds) in @tabState[tabId] that we don't need in the front end. Here, we only send the three properties which we do need.
2016-04-04Add backstop for global link hints.Stephen Blott
This is not at all satisfactory. I've seen cases where global link hints hangs, apparently because we do not hear back from a frame. The issue is repeatable when it happens, but not repeatable in general (if you reload the page, then it goes away). This suggests that there may be something fundamentally wrong with the global link-hints logic. However, what? In the interim, this adds a timer to trigger link-hints mode activation with whataver hints we do have after a short period of time. Ideally, we'll be able to get rid of this soon.
2016-04-04Better handling of port failures.Stephen Blott
If we lose contact with a frame (it's goine away) while still awaiting hints from that frame, then post a dummy/empty list of hints instead. This seems very unlikely to come up, but we should guard against it anyway. We use "nextTick()" so that we finish sending the current message before sending the dummy hints.
2016-04-04Handle all frames the same (for frames/ports).Stephen Blott
This is experimental, and may be reverted. I suspect that the special treatment of the top frame may actually be causing problems for global link hints (rather than solving them!).
2016-04-04Handle requireHref for link hints locally.Stephen Blott
The check that an element as an href (for certain hint modes) can be done earlier, thereby avoid the need to pass that information between frames.
2016-04-03Freeze frame state on link-hint activation.Stephen Blott
We take a copy of the frame Ids and ports at the point which link-hints mode is launched, and use that subsequently. Therefore, a newly created frame cannot cause the hint coordinator to become confused. Also: add debugging code.
2016-04-02Simplify UI component initialisation.Stephen Blott
There's no need for the previous complicated approach to UI component initialialisation, in particular for the Vomnibar. We only initialise the Vomnibar in the top frame. However, if for some reason it hasn't been initialised by the time it's needed, then we can just initialise it then. We are only initialising it early to avoid flicker, so it's not a correctness issue. And the only reason it wouldn't be initialised is if Vimium is disabled in the top frame, but enabled in some other frame -- which is not a common case.
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-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-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-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-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; rename message name.Stephen Blott
We cannot use "request" and "name" to describe a link-hints message. The message is then accepted (and fails) on the options page where there is no handler. So, here, use "messageType" instead of "name".
2016-03-28Global link hints...Stephen Blott
TODO: - fix tests
2016-03-26Rework global mark activation.Stephen Blott
There were two problems, both stemming from the fact that the notification was being displayed in the top frame, even if the mark was triggered in another frame: 1. That looks odd, because we close the HUD in one frame then open it in another. 2. As a side effect, we were moving the focus to the top frame. Here, we work out what's going to happen before sending the message to the background page. This allows us to display the message in the HUD in the frame which generated it.
2016-03-26Add test for badly-formed exclusion regexp.Stephen Blott
2016-03-26Multiple minor tweaks.Stephen Blott
Some of this code is showing its age, so these are just a number of minor tweaks (to keep things clear, consistent and concise). Also, add a couple of tests (while we're at it).
2016-03-26Merge branch 'standardise-foreground-commands'Stephen Blott
Conflicts: content_scripts/vimium_frontend.coffee
2016-03-26Get frameId in background page.Stephen Blott
2016-03-26Simplify expression.Stephen Blott
2016-03-26Move command to correct spot.Stephen Blott
This command (LinkHints.activateModeToCopyLinkUrl) has been in the wrong spot for quite some time. This just moves it to be with the other link-hints commands.
2016-03-26passCountToCommand isn't needed.Stephen Blott
We pass the count to *all* front-end commands. All of the commands which don't use a count, just ignore it.