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.
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.
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.
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.
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).
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.
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.
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.
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
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.