Commit graph

3270 commits

Author SHA1 Message Date
Denis Revunov
fc29f2823f Use MinimalKey internally, add terminator key to gobble mode 2022-10-30 20:59:10 +03:00
gholk
5af29e7246 Include header in webRequest BeforeSendHeaders and HeaderReceived events
Since we already have blocking and requestBody, adding requestHeaders and
responseHeaders should be okay too.
2022-10-29 15:17:57 +08:00
Oliver Blanthorn
621f014607
Merge pull request #4378 from GHolk/find-from-viewport
Find from the viewport
2022-10-28 17:42:58 +02:00
Oliver Blanthorn
979c6acb39
Suggest binds closer to Vim defaults 2022-10-28 17:41:18 +02:00
Nicolas
282d5eccbb
simplified undefined check
Co-authored-by: Oliver Blanthorn <freedom4cows@gmail.com>
2022-10-21 11:14:28 +02:00
Nicolas Ganz
d675e5af23 moved the selecction of the modifier keys to simulateClick 2022-10-21 08:29:30 +02:00
Nicolas Ganz
34e0c1dbc2 improve the fallbacks for opening tabs with hint
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.
2022-10-20 14:02:26 +02:00
Oliver Blanthorn
2f1f6520be
Improve autofocus docs (#3853) 2022-10-18 20:30:26 +02:00
Oliver Blanthorn
3b5966d57e
Merge pull request #4406 from micimize/patch-1
Add more detailed docs on containerized firefox install support
2022-10-16 11:49:33 +02:00
Michael Joseph Rosenthal
6210f364b3
Remove trailing whitespace 2022-10-15 09:09:51 -07:00
Michael Joseph Rosenthal
6a10ae83d9
Add link in help native and help nativeinstall 2022-10-15 09:03:22 -07:00
Igor
9f024cd972
Update the dark theme background color 2022-10-10 15:34:21 +03:00
Oliver Blanthorn
23d344a299
Improve Ctrl-V docs: fix #4337 2022-10-09 00:47:57 +02:00
Oliver Blanthorn
815222864b
Merge pull request #4409 from tridactyl/more_useful_empty_bind
Make empty bind return valid command (#4384)
2022-10-04 12:41:38 +02:00
Oliver Blanthorn
8a35150e1d
Remove equals sign from get (#4384)
This should allow users to more easily turn it into a :set
2022-10-04 11:15:01 +02:00
Oliver Blanthorn
04e5a6ffc1
Make empty bind return valid command (#4384) 2022-10-04 11:13:01 +02:00
Oliver Blanthorn
3fe9575a33
Cheer up prettier 2022-10-01 18:01:41 +02:00
Oliver Blanthorn
cff50597bf
Fix #4403: ensure bypassFocusHack is not left undefined 2022-10-01 18:01:32 +02:00
Oliver Blanthorn
22b2e9cb42
Fix #4384: remove excmd from bind completions 2022-09-30 16:03:10 +02:00
gholk
788180fdc9 Find node which can be focused in range the right way
Implement a method to query node in range, so the anchor node will always be
found even if it is not a ancestor of the range.startContainer.
2022-09-18 23:27:54 +08:00
gholk
785b593bc4 Reposition all match text before find from view
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.
2022-09-17 22:38:54 +08:00
gholk
cbafb8077e Fix wrong scrolling when the match not in root scroll element
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.
2022-09-17 22:38:31 +08:00
Oliver Blanthorn
a86a942f52
Merge branch 'master' into pretty_tab_status_symbols 2022-09-14 10:15:57 +02:00
Gold Holk
b218014913 Try to make the highlight's position always correct
This will reposition the highlight whenever user focus other match,
but the scroll behavior may work bad sometimes.
2022-09-09 23:53:24 +08:00
Gold Holk
725dcf92f1 Overwrite get*ClientRect methods directly
So the DOM.isVisible should work on findhightlight directly.
2022-09-09 23:44:14 +08:00
gholk
03a8a4cf39 Fix firefox html custom element not work in WebExtension content-script
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.
2022-09-09 18:57:16 +08:00
Luka Markušić
4ede950ee1 Update docs
All the clippy files are markdown files, not html
2022-09-06 10:01:54 +02:00
gholk
696510a50f Support focus anchor button input details in find
The dom.ts is fixed a little to improve type check.
2022-09-04 15:08:56 +08:00
gholk
d76ad67fe1 Make DOM.isVisible support Range objects
The Range objects have getBoundingClientRect method too,
so it should be acceptable for the DOM.isVisible function.
2022-09-04 00:24:42 +08:00
gholk
b723a7dfba Move FindHighlight focus and unfocus to public method
There is no reason to define them as a new function in constructor
2022-09-04 00:15:36 +08:00
gholk
3ee801de14 Support getting ranges from the find results
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.
2022-09-03 20:02:04 +08:00
Oliver Blanthorn
abfc339136
Merge pull request #4363 from GHolk/expand-searchurl-recursively
Add recursive expansion to searchurls and jsurls
2022-09-02 17:02:59 +02:00
Oliver Blanthorn
49fd5b8e5b
Add docs for searchurl aliases 2022-09-02 17:01:21 +02:00
gholk
7a374c9235 Docs and types for the arg_util.ts 2022-09-02 22:57:17 +08:00
Gold Holk
77cf95d530 Make next n work if lastSearchQuery is undefined
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.
2022-09-02 22:55:13 +08:00
Gold Holk
9e5092a246 Docs for new find options and implement the jump-to option
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.
2022-09-02 22:29:18 +08:00
gholk
d5173c0773 Replace minimist with arg for permissive feature
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.
2022-09-01 23:23:16 +08:00
gholk
b4ebaf5186 Fix the findnext behavior after find -?
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 -?`.
2022-08-26 22:20:50 +08:00
gholk
8e3d023cde Add reverse option for findnext for better reverse finding
With the reverse option, we can do inverse findnext with number prefix.
This commit also import minimist as arguments parsing library.
2022-08-24 22:07:58 +08:00
gholk
090858e16b Make excmd findnext support search from viewport
To search from view with ex command findnext,
pass the `-r` or the `--search-from-view` option.
2022-08-24 21:17:42 +08:00
gholk
fb2173871f Allow finding.jumpToNextMatch find from the current viewport
Add option to find from the current viewport,
and add isVisible method to FindHighlight.
The reverse finding is not cover now.
2022-08-23 21:42:33 +08:00
Gold Holk
1d7795f40a Add recursive expansion to searchurls and jsurls
Therefore we can have alias in searchurls and jsurls just like alias
2022-08-22 20:43:49 +08:00
gholk
a403999cdc Fix the DOM.isVisible for finding highlight element
The highlight element's position is set to `top: 0; left: 0;`,
so it will never be visible. We should test its child nodes instead.
2022-08-18 20:33:55 +08:00
Gold Holk
b81c9dcdb7 Add fuse search in undo and fix undo session id is undefind
Allow fuse search with url in undo completion.
Fix undo access undefined value in session,
though I don't see anyone cares the return value of undo.
2022-08-11 22:16:21 +08:00
Gold Holk
1015f540d1
Fix wrong empty selection detect
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.
2022-08-10 11:18:32 +08:00
gholk
c90482042e Fix timestamp in completion of back command for shydactyl
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.
2022-08-03 19:43:53 +08:00
gholk
649d2009e8 Add documentation for most autocmd events
Add details for DocStart, DocLoad, DocEnd, TabEnter, TabLeft,
HistoryState, HistoryPushState and HistoryReplace in
autocmd's JSDoc, and correct HistoryPopState to HistoryPushState.
2022-07-25 22:29:52 +08:00
Oliver Blanthorn
92e143cfb8
Merge pull request #4284 from davidscotson/forced-color-mode
Fix #4283 to improve forced-color support
2022-06-30 22:11:21 +02:00
gholk
63b239cb36 Fix previous commit subconfig prefix bug
without shift, mktridactyl will generate
seturl with subconfig keypath.
this commit removes it.
2022-06-26 14:45:52 +08:00
gholk
82ed8447b1 Fix #4285: mktridactyl output wrong seturl command
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.
2022-06-25 22:05:54 +08:00