Commit graph

10 commits

Author SHA1 Message Date
Oliver Blanthorn
095ce771ea
Formatting: run all typescript through prettier 2018-04-13 19:28:03 +01:00
John Beard
feda3bc8e6 Add URL interpolation function and tests
This includes logic to automatically percent-encode the query if it
occurs in the the query string of the URL pattern.

If this automatic logic is not enough in future, the same function can
be extended with an explicit encoding flag as needed.
2018-02-01 16:43:13 +00:00
John Beard
6bc3b5ae97 Add urlmodify command
Has a few modes:

    -t: Straight text replacement
    -r: Regexp replacement
    -q: Change a query's value to a new one
    -Q: Delete a given query (and value if present)
    -g: Graft a path onto the current URL (or a parent path of it)

These can be used direct on the command line, or bound to keybindings.
The idea is to allow commands to easily navigate around a website. For
example, navigating to a project's issues page on GitHub can be done
with a graft command, and changing an query is useful on sites like
eBay.

As a URL modification is generally site-specific, binding will be much
more useful with aucmds.
2018-01-21 17:14:57 +00:00
Colin Caine
5fe6068b4a url_util: Keep trailing slashes
And don't remove repeated slashes until they're at the end.
2017-12-27 14:37:01 +00:00
Colin Caine
df9451e83e url_util: Fix #256. 2017-12-26 13:56:35 +00:00
John Beard
fde956df53 Add save link/img hint submode (;s, ;S, ;a, ;A)
This adds the ability to save link targets or images. The save location
can be default, or the save as dialog can be invoked.

Somewhat sensible default filenames are provided.

Data URLs are also supported (though they need quite a bit of massaging
to get past the WebExt security limitations). Specificially, they need
to be round-tripped though a Blob, and must be saved from the background
context.
2017-12-24 11:20:26 +00:00
Anton
022f462396 addressing issue #231, urlparent now accepts a count. 2017-12-19 18:47:34 +00:00
John Beard
27116a3416 Add urlparent (gu) command
This command changes the URL to the parent URL.

Normal mode binding 'gu' added: same as Vimperator.
2017-11-21 12:12:25 +00:00
John Beard
44455692e8 Add urlroot (gU) command
Opens the root domain of the current tab's URL. E.g.
"https://example.com/page" -> "http://example.com/"

Includes 'gU' binding (same as Vimperator)
2017-11-21 12:12:15 +00:00
John Beard
8f8982cde1
Add incrementurl command
Increments the last number in a URL by a given step (positive or
negative)

Also includes a url_util helper module and some tests for it

Logic taken from vimperator browser.js:17
2017-11-21 11:05:40 +00:00