Commit graph

2519 commits

Author SHA1 Message Date
Oliver Blanthorn
66cdc89536
Merge pull request #1290 from glacambre/fix_1197
Make more functions return their last promise
2019-01-21 20:14:45 +00:00
glacambre
beaefa444b
excmds.ts: Make sure getRssLinks() only works with string hrefs
Apparently, on github,
`document.querySelectorAll("a,link[rel='alternate']")` can return
anchors that are actually svg elements. This would be fine if these
elements had string hrefs, but that's not the case. These elements have
svg hrefs and this makes getRssLinks() fail, which in turn makes opening
the command line fail because of completions. The easy solution is to
simply make sure elements have a string href. The hard solution is
creating a proper statusline where errors will be logged without taking
over the command line.
2019-01-21 20:04:26 +01:00
Oliver Blanthorn
ad2a4974f0
Merge pull request #1289 from glacambre/fix_1288
src/excmds.ts: fix overwritting objects with strings on user error
2019-01-21 18:49:51 +00:00
glacambre
ae506cc65b
Make more functions return their last promises
https://github.com/tridactyl/tridactyl/issues/1197 is a bug where
settings aren't properly loaded on `:source` because tridactyl performs
concurrent writes on the config. Making sure every function/excmd
returns its last promise restores synchronicity when it's needed and
should thus fix #1197.
2019-01-21 19:49:24 +01:00
glacambre
0fe3d190c8
src/excmds.ts: fix overwritting objects with strings on user error
https://github.com/tridactyl/tridactyl/issues/1288 reports that
Tridactyl will happily overwrite a setting the type of which is
`object` with a string. This was caused by not checking whether
the setting being overwritten was a top-level object or a member of said
object. This commit fixes that.

Closes #1288.
2019-01-21 19:15:00 +01:00
Oliver Blanthorn
214df84301
Merge pull request #1287 from glacambre/better_errors
native_background.ts: Improve error messages on native messenger ops
2019-01-20 13:04:00 +00:00
glacambre
cfc4bccba9
native_background.ts: Improve error messages on native messenger ops
This should help with situations such as https://github.com/tridactyl/tridactyl/issues/1284.
2019-01-20 09:15:28 +01:00
Oliver Blanthorn
ddfb5b5135
Merge pull request #1285 from glacambre/fix_icons
Fix icons
2019-01-19 17:20:55 +00:00
Oliver Blanthorn
40d37695bf
Merge pull request #1286 from glacambre/impl_undo_completions
Impletment sessions completion
2019-01-19 17:18:11 +00:00
glacambre
a353c51354
Impletment sessions completion
Sessions completion let us provide completions for the `:undo` ex
command, which can be useful if you need to restore an older tab.

Closes https://github.com/tridactyl/tridactyl/issues/1127.
2019-01-19 18:06:05 +01:00
glacambre
3ddf350dc0
html-tagged-template.js: Authorize more protocols
https://github.com/straker/html-tagged-template/issues/26 discusses
authorizing the data:// protocol. The gist of it is that it's dangerous
because data:text/html can be used for XSS attacks. We circumvent this
problem by only explicitly allowing a few image formats formatted as
base64.
2019-01-19 15:41:32 +01:00
glacambre
d1ce62ec6d
html-tagged-template.js: Accept moz-extension protocol
html-tagged-template.js forbids every protocol except http:// when
sanitizing urls. This prevents Tridactyl from loading its icons from
moz-extension urls. This commit fixes that (ignore prettier reformatting
the file, the only line I actually changed was line 314 before prettier
which became line 467 after prettier).
2019-01-19 15:21:24 +01:00
Oliver Blanthorn
3cf176bb05
Fix minor typos 2019-01-15 17:54:42 +00:00
Oliver Blanthorn
fba8087ef6
Disable find completion: it breaks stuff 2019-01-15 17:51:20 +00:00
Oliver Blanthorn
2176c8feae
Make find context text bigger and more useful 2019-01-15 17:50:51 +00:00
Oliver Blanthorn
19e6cc4ca2
Re-enable commandline completions 2019-01-15 17:32:29 +00:00
Oliver Blanthorn
c545c42514
Make find settings use the new typed configurations 2019-01-15 17:27:08 +00:00
Oliver Blanthorn
6992eb5699
Update package-lock 2019-01-15 17:09:34 +00:00
Oliver Blanthorn
2ee47a9941
Merge branch 'master' into make_find_faster
Rebases are for people who understand how git works.
2019-01-15 17:09:16 +00:00
Oliver Blanthorn
e62eae4d15
Fix #1280: pad hints slightly more 2019-01-15 10:50:15 +00:00
Oliver Blanthorn
a81a14268f
Update settings tutorial to include help [setting] 2019-01-13 16:14:13 +00:00
Oliver Blanthorn
42c2725a9f
Update package-lock 2019-01-13 16:12:24 +00:00
Oliver Blanthorn
2046dc2d26
Merge pull request #1276 from glacambre/fix_wordpattern_doc
config.ts: fix wordpattern documentation
2019-01-10 19:08:17 +00:00
glacambre
a971e3a4ea
config.ts: fix wordpattern documentation 2019-01-10 18:12:57 +01:00
Oliver Blanthorn
ec8e2cebef
Merge pull request #1271 from glacambre/add_reset_button
help.ts: Add config-resetting button
2019-01-05 20:17:31 +00:00
glacambre
c2f1538366
help.ts: Add config-resetting button
As mentionned in https://github.com/tridactyl/tridactyl/issues/57 and
https://github.com/tridactyl/tridactyl/pull/502.
2019-01-05 19:51:52 +01:00
Oliver Blanthorn
253aac3d02
Merge pull request #1268 from mandre/doc-fixups
Doc fixups
2019-01-02 16:32:15 +00:00
Martin André
208435208c Fix rendering for reset and reseturl related links
Wrong indentation caused the "See also" section for `reset` and
`reseturl` commands documentation to render HTML <a> tags instead of
links.
2019-01-02 16:53:40 +01:00
Martin André
eefa9ceb50 Fix followpagepatterns examples
The example for followpagepatterns.prev was wrongly using `»` and `>>`
instead of `«` and `<<`.
2019-01-02 16:51:12 +01:00
Oliver Blanthorn
c04316c231
Merge pull request #1266 from glacambre/warn_rsscmd
config.ts: Warn about rsscmd being potentially very dangerous
2018-12-31 20:18:15 +00:00
glacambre
f310c9343d
config.ts: Warn about rsscmd being potentially very dangerous 2018-12-31 21:06:44 +01:00
glacambre
ad737c4689
excmds.ts: Make getRssLinks() return more matches
Standards are for nerds and the BBC isn't for nerds, that's why they use
regular anchors instead of alternate links in order to point to rss
documents on the following page:
https://www.bbc.com/news/10628494

This commit makes sure these links are also picked up by rssexec.
2018-12-29 21:05:45 +01:00
glacambre
b491bcbb29
Turn rsscmd into an ex command
As suggested by bovine3dom in #1263.
2018-12-28 11:21:11 +01:00
glacambre
be315ac967
Implement getrss completions 2018-12-27 11:05:47 +01:00
glacambre
10eade5646
{excmds,lib/config}.ts: implement getrss ex command
The getrss command lives in the background for easy communication with
the native messenger and uses a helper, getRssLinks, that lives in the
content script.
2018-12-27 11:05:22 +01:00
Oliver Blanthorn
5e7d716a0b
Merge pull request #1262 from glacambre/remove_return_await
Replace `return await promise` with `return promise`
2018-12-26 14:56:24 +00:00
glacambre
ab196175ac
Replace return await promise with return promise
Awaiting a promise before returning it doesn't make sense if the await
isn't in a try/catch as awaiting forces a function to be async and thus
turns its return value and any error it might throw into a promise.
Worse than that, it can result in an unnecessary context switch which
could be bad for performance.
2018-12-26 15:33:22 +01:00
Oliver Blanthorn
c2324d68a7
Merge pull request #1259 from glacambre/refresh_completions_faster_on_fillcmdline
commandline_frame.ts: stop using dirty hacks for completions
2018-12-24 08:35:04 +00:00
glacambre
55d6a1e0e6
commandline_frame.ts: stop using dirty hacks for completions
The previous code simulated an input event in order to trigger the input
event handler which recomputed completions. This was ok until delays
were added to the input event handlers in order to reduce the lag that
could happen when typing fast/keeping a key pressed. This delay also
affects completion computation on other actions, such as fillcmdline.

In order to remove this delay, we move completion computation out of the
event handler and directly call this functions everywhere we previously
triggered an input event.

This should help with https://github.com/tridactyl/tridactyl/issues/1242
2018-12-24 09:26:57 +01:00
Oliver Blanthorn
828703ecc4
Merge pull request #1257 from glacambre/use_browserbg
completions: Use browserBg instead of messaging background
2018-12-23 16:02:00 +00:00
glacambre
b97b6dc62e
completions: Use browserBg instead of messaging background
commandline_background.ts:history() isn't used anywhere and is wrong (it
doesn't respect the historyresults setting) so this commit removes it.
Also, currentWindowTabs and allWindowTabs are both used in a single
place (respectively Tab and TabAll completions) and do not perform anything
complicated, thus it's better to have completions juste use browserBg
instead of manually messaging the background process.
2018-12-23 16:37:34 +01:00
Oliver Blanthorn
1ed5823057
Merge branch 'move_fillcmdline_content' 2018-12-23 15:01:45 +00:00
Oliver Blanthorn
3e4e77fe10
Update package-lock 2018-12-23 15:01:32 +00:00
Oliver Blanthorn
2b18552716
Update changelog 2018-12-20 23:04:14 +00:00
Oliver Blanthorn
367de75bcc
Merge branch 'MilanV-master' 2018-12-20 23:02:37 +00:00
Oliver Blanthorn
45b7dcc526
Rename showcmd to modeindicatorshowkeys 2018-12-20 22:58:32 +00:00
Oliver Blanthorn
056d881851
Add snow_mouse_mode 2018-12-20 22:32:24 +00:00
glacambre
b6d358969d
excmds.ts: Move fillcmdline* to content script 2018-12-20 08:15:44 +01:00
glacambre
c259283e96
excmds.ts: Move hidecmdline to content script 2018-12-20 07:47:54 +01:00
glacambre
c9bcd37033
excmds.ts: Move showcmdline to content script 2018-12-20 07:47:33 +01:00