Firefox does not allow browser.tabs.create to create new tabs with file:// urls. For those cases this workaround not just clicks the links but uses the appropriate modifier keys to open the links in tabs, either in the background or foreground.
If user scrolled and the match text position change, the `.top` property will
not update automatically. Then the search from view will return the wrong
match text because it make use of the old top properties.
This commit reposition (and the top properties get updated) all match text
before find the next match from the viewport.
If the match text is inside a scrollable element which is not root,
the highlight rectangle will be in a wrong position, because
the position is relative the root element but not the scrolling element,
and scroll to the hightlight rectangle will not make the matched text visible.
This commit make focus method scroll to the match text range instead of the
highlight rectangle by a scrollIntoView polyfill library, which does not
check the input strictly, and the highlight rectangle position will update
after the scroll is performed.
It seem that the custom element will not have right prototype,
and the user defined properties and method will be undefined.
This is cause by a firefox bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1716685
This commit monkey patchs the element manually in constructor
to fix this problem.
New excmd `findselect` to select the current match result of the `find`
command.
The FindHighlight `content/finding.ts` is also rewrite to store the exact
matched range.
If there is no existing search when the `findnext` called,
it will try to use the last search from other page,
but the number to jump is not handled in this case.
This commit try to jump to the next n after the search.
There is a `-:` option in the docs of `find`, but it is not implemented.
This commit implement it.
The new docs of `--search-from-view` and `--reverse` are added, too.
The npm package arg is more flexible than the old arguments parser minimist.
The arg can left the unknown option unchanged,
(while there is a bug that splits the unknown short options,)
and stop at positional arguments are supported, too.
This commit should make the findnext whit negative argument work fine,
and all combination of [reverse, negative] is take cared.
This may change the original behavior of find, because the original
implementation is buggy.
The `findnext -r` is renamed to `findnext -?` to follow the style of `find -?`.
The anchorOffset and the focusOffset are counted from the anchorNode and the focusNode.
They may be different node, so a same offset does not mean empty selection.
Just isCollapsed is enough.
The completion for back/forward can show the history list.
The item contain title, url and timestamp,
but timestamp does not show up in shydactyl theme,
because the `.url` and `.title` both takes `width: 50%;`,
so no space is left for the timestamp.
This commit remove the `.title`'s width contrain,
so the title will adjust its width automatically.
Also style `.time` to appropriate width and align right.
Add details for DocStart, DocLoad, DocEnd, TabEnter, TabLeft,
HistoryState, HistoryPushState and HistoryReplace in
autocmd's JSDoc, and correct HistoryPopState to HistoryPushState.
If there are more than one seturl/bindurl config
in one url, `mktridactylrc` will outputs wrong
seturl/bindurl commands, which become global settings.
Because `prefix.shift()` will mutate the array.
Then in the next iteration, the subconfig and url in prefix
will miss.