Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmanstout committed Nov 18, 2017
2 parents 550623c + e8d0fe5 commit fd98be2
Show file tree
Hide file tree
Showing 63 changed files with 1,743 additions and 1,294 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
@@ -1,3 +1,3 @@
[submodule "tests/shoulda.js"]
path = tests/shoulda.js
url = git://github.com/philc/shoulda.js.git
url = https://github.com/philc/shoulda.js.git
14 changes: 8 additions & 6 deletions .travis.yml
@@ -1,11 +1,13 @@
sudo: false
language: node_js
node_js: 0.12
node_js: "8"
before_install:
- "npm install -g coffee-script"
- "npm install path@0.11"
- "npm install util"
- "cake build"
script: "cake test"
- npm install -g coffee-script
- npm install path@0.11
- npm install util
- npm install -g phantomjs@1.9.20
- cake build
script: cake test
notifications:
email: false
branches:
Expand Down
15 changes: 11 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -3,17 +3,24 @@
You'd like to fix a bug or implement a feature? Great! Check out the bugs on our issues tracker, or implement
one of the suggestions there that have been tagged "help wanted". If you have a suggestion of your own, start
a discussion on the issues tracker or on the
[mailing list](http://groups.google.com/group/vimium-dev?hl=en). If it mirrors a similar feature in another
[mailing list](https://groups.google.com/group/vimium-dev?hl=en). If it mirrors a similar feature in another
browser or in Vim itself, let us know. Once you've picked something to work on, add a comment to the
respective issue so others don't duplicate your effort.

## Reporting Issues

Please include the following when reporting an issue:

1. Chrome and OS Version: `chrome://version`
### Chrome/Chromium

1. Chrome/Chromium and OS Version: `chrome://version`
1. Vimium Version: `chrome://extensions`

### Firefox

1. Firefox and OS Version: `about:`
1. Vimium Version: `about:addons`, then click on `More` below Vimium

## Installing From Source

Vimium is written in Coffeescript, which compiles to Javascript. To
Expand All @@ -37,7 +44,7 @@ Our tests use [shoulda.js](https://github.com/philc/shoulda.js) and [PhantomJS](

1. `git submodule update --init --recursive` -- this pulls in shoulda.js.
1. Install [PhantomJS](http://phantomjs.org/download.html).
1. `npm install path@0.11` to install the [Node.js Path module](http://nodejs.org/api/path.html), used by the test runner.
1. `npm install path@0.11` to install the [Node.js Path module](https://nodejs.org/api/path.html), used by the test runner.
1. `npm install util` to install the [util module](https://www.npmjs.com/package/util), used by the tests.
1. `cake build` to compile `*.coffee` to `*.js`
1. `cake test` to run the tests.
Expand All @@ -47,7 +54,7 @@ Our tests use [shoulda.js](https://github.com/philc/shoulda.js) and [PhantomJS](
You can find out which portions of code need them by looking at our coverage reports. To generate these
reports:

1. Download [JSCoverage](http://siliconforks.com/jscoverage/download.html) or `brew install jscoverage`
1. Download [JSCoverage](https://siliconforks.com/jscoverage/download.html) or `brew install jscoverage`
1. `npm install temp`
1. `cake coverage` will generate a coverage report in the form of a JSON file (`jscoverage.json`), which can
then be viewed using [jscoverage-report](https://github.com/int3/jscoverage-report). See
Expand Down
1 change: 1 addition & 0 deletions CREDITS
Expand Up @@ -48,5 +48,6 @@ Contributors:
Scott Pinkelman <scott@scottpinkelman.com> (github: sco-tt)
Darryl Pogue <darryl@dpogue.ca> (github: dpogue)
tobimensch
Ramiro Araujo <rama.araujo@gmail.com> (github: ramiroaraujo)

Feel free to add real names in addition to GitHub usernames.
9 changes: 8 additions & 1 deletion Cakefile
Expand Up @@ -77,6 +77,9 @@ task "package", "Builds a zip file for submission to the Chrome store. The outpu
spawn "rsync", rsyncOptions, false, true
spawn "zip", ["-r", "dist/vimium-#{vimium_version}.zip", "dist/vimium"], false, true

spawn "zip", "-r -FS dist/vimium-ff-#{vimium_version}.zip background_scripts Cakefile content_scripts CONTRIBUTING.md CREDITS icons lib
manifest.json MIT-LICENSE.txt pages README.md -x *.coffee -x Cakefile -x CREDITS -x *.md".split(/\s+/), false, true

# This builds a CRX that's distributable outside of the Chrome web store. Is this used by folks who fork
# Vimium and want to distribute their fork?
task "package-custom-crx", "build .crx file", ->
Expand All @@ -86,7 +89,11 @@ task "package-custom-crx", "build .crx file", ->
# ugly hack to modify our manifest file on-the-fly
origManifestText = fs.readFileSync "manifest.json"
manifest = JSON.parse origManifestText
manifest.update_url = "http://philc.github.com/vimium/updates.xml"
# Update manifest fields that you would like to override here. If
# distributing your CRX outside the Chrome webstore in a fork, please follow
# the instructions available at
# https://developer.chrome.com/extensions/autoupdate.
# manifest.update_url = "http://philc.github.com/vimium/updates.xml"
fs.writeFileSync "manifest.json", JSON.stringify manifest

pem = process.env.VIMIUM_CRX_PEM ? "vimium.pem"
Expand Down
75 changes: 66 additions & 9 deletions README.md
@@ -1,7 +1,7 @@
Vimium - The Hacker's Browser
=============================

[![Build Status](https://secure.travis-ci.org/philc/vimium.png?branch=master)](https://travis-ci.org/philc/vimium)
[![Build Status](https://travis-ci.org/philc/vimium.svg?branch=master)](https://travis-ci.org/philc/vimium)

Vimium is a Chrome extension that provides keyboard-based navigation and control of the web in the spirit of
the Vim editor.
Expand All @@ -12,7 +12,7 @@ You can install the stable version of Vimium from the
[Chrome Extensions Gallery](https://chrome.google.com/extensions/detail/dbepggeogbaibhgnhhndojpepiihcmeb).

Please see
[CONTRIBUTING.md](https://github.com/philc/vimium/blob/master/CONTRIBUTING.md#installing-from-source)
[CONTRIBUTING.md](CONTRIBUTING.md#installing-from-source)
for instructions on how you can install Vimium from source.

The Options page can be reached via a link on the help dialog (type `?`) or via the button next to Vimium on
Expand Down Expand Up @@ -80,6 +80,7 @@ Manipulating tabs:
x close current tab
X restore closed tab (i.e. unwind the 'x' command)
T search through your open tabs
W move current tab to new window
<a-p> pin/unpin current tab

Using marks:
Expand Down Expand Up @@ -140,28 +141,80 @@ The following special keys are available for mapping:

- `<c-*>`, `<a-*>`, `<m-*>` for ctrl, alt, and meta (command on Mac) respectively with any key. Replace `*`
with the key of choice.
- `<left>`, `<right>`, `<up>`, `<down>` for the arrow keys
- `<space>` and `<backspace>` for the space and backspace keys
- `<f1>` through `<f12>` for the function keys
- `<left>`, `<right>`, `<up>`, `<down>` for the arrow keys.
- `<f1>` through `<f12>` for the function keys.
- `<space>` for the space key.
- `<tab>`, `<enter>`, `<delete>`, `<backspace>`, `<insert>`, `<home>` and `<end>` for the corresponding non-printable keys (version 1.62 onwards).

Shifts are automatically detected so, for example, `<c-&>` corresponds to ctrl+shift+7 on an English keyboard.

More documentation
------------------
Many of the more advanced or involved features are documented on
[Vimium's github wiki](https://github.com/philc/vimium/wiki). Also
[Vimium's GitHub wiki](https://github.com/philc/vimium/wiki). Also
see the [FAQ](https://github.com/philc/vimium/wiki/FAQ).

Contributing
------------
Please see [CONTRIBUTING.md](https://github.com/philc/vimium/blob/master/CONTRIBUTING.md) for details.
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Firefox Support
---------------

There is an *experimental* port of Vimium on Firefox [here](https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/).
This is very much experimental: most features work, although some bugs and issues remain.

PRs are welcome.

Release Notes
-------------

Changes since the previous release (not yet in the Chrome Store version)
In `master` (not yet released)

- Backup and restore Vimium options (see the very bottom of the options page, below *Advanced Options*).
- It is now possible to map `<tab>`, `<enter>`, `<delete>`, `<insert>`, `<home>` and `<end>`.

1.61 (2017-10-27)

- For *filtered hints*, you can now use alphabetical hint characters
instead of digits; use `<Shift>` for hint characters.
- With `map R reload hard`, the reload command now asks Chrome to bypass its cache.
- You can now map `<c-[>` to a command (in which case it will not be treated as `Escape`).
- Various bug fixes, particularly for Firefox.
- Minor versions:
- 1.61.1: Fix `map R reload hard`.

1.60 (2017-09-14)

- Features:
- There's a new (advanced) option to ignore the keyboard layout; this can
be helpful for users of non-Latin keyboards.
- Firefox support. This is a work in progress; please report any issues
[here](https://github.com/philc/vimium/issues?q=is%3Aopen+sort%3Aupdated-desc);
see the [add
on](https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/).

- Bug fixes:
- Fixed issue affecting hint placement when the display is zoomed.
- Fixed search completion for Firefox (released as 1.59.1, Firefox only).

- Minor versions:
- 1.60.1: fix [#2642](https://github.com/philc/vimium/issues/2642).
- 1.60.2: revert previous fix for HiDPI screens. This was breaking link-hint positioning for some users.
- 1.60.3: [fix](https://github.com/philc/vimium/pull/2649) link-hint positioning.
- 1.60.4: [fix](https://github.com/philc/vimium/pull/2602) hints opening in new tab (Firefox only).

1.59 (2017-04-07)

- Features:
- Some commands now work on PDF tabs (`J`, `K`, `o`, `b`, etc.). Scrolling and other content-related commands still do not work.

1.58 (2017-03-08)

- Features:
- The `createTab` command can now open specific URLs (e.g, `map X createTab http://www.bbc.com/news`).
- With pass keys defined for a site (such as GMail), you can now use Vimium's bindings again with, for example, `map \ passNextKey normal`;
this reactivates normal mode temporarily, but *without any pass keys*.
- You can now map multi-modifier keys, for example: `<c-a-X>`.
- Vimium can now do simple key mapping in some modes; see
[here](https://github.com/philc/vimium/wiki/Tips-and-Tricks#key-mapping).
Expand All @@ -171,6 +224,10 @@ Changes since the previous release (not yet in the Chrome Store version)
- Process:
- In order to provide faster bug fixes, we may in future push new releases without the noisy notification.

- Post-release minor fixes:
- 1.58.1 (2017-03-09) fix bug in `LinkHints.activateModeWithQueue` (#2445).
- 1.58.2 (2017-03-19) fix key handling bug (#2453).

1.57 (2016-10-01)

- New commands:
Expand Down Expand Up @@ -434,7 +491,7 @@ Changes since the previous release (not yet in the Chrome Store version)
- Arrow keys and function keys can now be mapped using &lt;left&gt;, &lt;right&gt;, &lt;up&gt;, &lt;down&gt;,
&lt;f1&gt;, &lt;f2&gt;, etc. in the mappings interface.
- There is a new command `goUp` (mapped to `gu` by default) that will go up one level in the URL hierarchy.
For example: from http://vimium.github.com/foo/bar to http://vimium.github.com/foo. At the moment, `goUp`
For example: from https://vimium.github.io/foo/bar to https://vimium.github.io/foo. At the moment, `goUp`
does not support command repetition.
- Bug fixes and optimizations.

Expand Down
33 changes: 32 additions & 1 deletion background_scripts/bg_utils.coffee
Expand Up @@ -18,7 +18,7 @@ class TabRecency
@deregister removedTabId
@register addedTabId

chrome.windows.onFocusChanged.addListener (wnd) =>
chrome.windows?.onFocusChanged.addListener (wnd) =>
if wnd != chrome.windows.WINDOW_ID_NONE
chrome.tabs.query {windowId: wnd, active: true}, (tabs) =>
@register tabs[0].id if tabs[0]
Expand Down Expand Up @@ -85,4 +85,35 @@ BgUtils =
continue if line[0] in '#"'
line

# Utility for parsing and using the custom search-engine configuration. We re-use the previous parse if the
# search-engine configuration is unchanged.
SearchEngines =
previousSearchEngines: null
searchEngines: null

refresh: (searchEngines) ->
unless @previousSearchEngines? and searchEngines == @previousSearchEngines
@previousSearchEngines = searchEngines
@searchEngines = new AsyncDataFetcher (callback) ->
engines = {}
for line in BgUtils.parseLines searchEngines
tokens = line.split /\s+/
if 2 <= tokens.length
keyword = tokens[0].split(":")[0]
searchUrl = tokens[1]
description = tokens[2..].join(" ") || "search (#{keyword})"
engines[keyword] = {keyword, searchUrl, description} if Utils.hasFullUrlPrefix searchUrl

callback engines

# Use the parsed search-engine configuration, possibly asynchronously.
use: (callback) ->
@searchEngines.use callback

# Both set (refresh) the search-engine configuration and use it at the same time.
refreshAndUse: (searchEngines, callback) ->
@refresh searchEngines
@use callback

root.SearchEngines = SearchEngines
root.BgUtils = BgUtils

0 comments on commit fd98be2

Please sign in to comment.