Commit graph

3335 commits

Author SHA1 Message Date
Oliver Blanthorn
b556c02a90
Cheer up eslint 2022-11-07 16:50:13 +01:00
gholk
e6ada5f9d0 Add docs for hintElements and hint -x exclude option
Docs and fix callback name collision bugs for hintElements.
2022-11-06 19:13:13 +08:00
gholk
e0ff5823c6 Move some code out of async generator to prevent bug
The async generator will not execute until iteration start.
Moving hintPage function out of async generator make it execute
even if there is no iteration.
2022-11-06 18:22:46 +08:00
gholk
4713c73b98 Make hintElements support rapid and return async iterator
If hintElements run in rapid mode, every selected element is returned
in an async iterator.
2022-11-06 10:23:30 +08:00
gholk
f07e9c3aa2 Function to hint user specified elements: tri.hinting_content.hintElements
A simple wraper for function hintPage, make user easy to choose from
a elements list.
2022-11-05 19:41:19 +08:00
gholk
7f626ad4dd Option to exclude selectors from hint result
Pass `-x selector` will exclude elements from the hint result.
2022-11-05 16:39:57 +08:00
Oliver Blanthorn
ab67dea1c3
Merge pull request #4440 from treapster/gobble-accept-terminator
Use MinimalKey internally, add terminator key to gobble mode
2022-11-03 13:57:56 +01:00
Denis Revunov
3fcc80f055 Remove outdated comments 2022-11-03 15:25:51 +03:00
Denis Revunov
07fde5eaff Fix match, strip Shift from printable keys 2022-11-03 15:16:29 +03:00
Denis Revunov
5a7e99bea2 Isolate key translation 2022-11-02 02:09:13 +03:00
Denis Revunov
59634e3e08 Revert "Bikeshed some types"
This reverts commit 74d357e1e2.
2022-11-02 01:51:08 +03:00
Oliver Blanthorn
0233be6e7d
Merge pull request #4430 from ThunderKey/feature/improve-open-tab-fallbacks
improve the fallbacks for opening tabs with hint
2022-11-01 17:11:15 +01:00
Oliver Blanthorn
edc57ebce5
Allow complex terminators for gobble mode 2022-11-01 16:40:24 +01:00
Oliver Blanthorn
88e8f9bb34
Add function to canonicalise map strings 2022-11-01 16:34:46 +01:00
Oliver Blanthorn
74d357e1e2
Bikeshed some types 2022-11-01 16:06:45 +01:00
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