Commit graph

3335 commits

Author SHA1 Message Date
glacambre
a0e4060a94 excmds.ts: document new tri.tabs object enabling access to tab windows 2024-01-24 08:04:53 +01:00
glacambre
37d841df2c Enable accessorless access to tab processes
This commit enables accessing content script values directly, like this:

(await tri.tabs[3].document.location.href)
tri.tabs[6].document.title = "New title!"
tri.tabs[9].tri.excmds.js("document.getElementById('blah').textContent").then(console.log)

Note that setting values, as shown in the above document.title example
above, cannot be synchronously, i.e. there is no way to wait for the
value to have been written is the content process before the background
process moves on to the next instruction. This is considered okay as
writing to the content process synchronously can be done with
(await tri.excmds.js("document.title = 'New title!'")) instead.

At the moment, accessing all tabs by not specifying an index in tri.tabs
is still not supported.
2024-01-24 07:49:57 +01:00
glacambre
3806445d85 Implement basic proxy providing easy access to tabs from background
This commit implements a basic proxy enabling access to arbitrary
values/functions in tabs from the background script, like this:

tri.tabs[3].document.title.get().then(console.log)
tri.tabs[3].document.title.set("New title!").then(console.log)
tri.tabs[9].alert.apply("Hello world!")
tri.tabs[12].tri.excmds.js.apply("alert('Hello world!')")

Ease of implementation was chosen above ease of use. Enabling reading,
writing and calling directly through property accesses instead of
forcing the use of .get()/.set()/.apply() will be attempted in another
commit.
2024-01-24 07:49:57 +01:00
Oliver Blanthorn
61c302e0c0
Fix lint issues 2024-01-23 19:57:53 +01:00
Oliver Blanthorn
dd535a4e32
Merge pull request #4791 from petoncle/fix-wrong-behavior-of-tabopen-with-containers
Fix wrong behavior of :tabopen with containers
2023-12-16 19:20:30 +00:00
Oliver Blanthorn
159d1ec0c0
Merge pull request #4844 from jumper047/feature/next-prev-line
Add functions to move cursor up and down in text areas
2023-12-16 19:18:18 +00:00
Oliver Blanthorn
ec342c4839
Merge pull request #4809 from petoncle/attempt-to-buffer-keyboard-events-until-commandline-opened
Reduce likelihood of losing characters while command line is opening
2023-12-16 19:01:00 +00:00
petoncle
ac7d7e577b Buffer page keys only for commands that open and focus the cmdline 2023-12-16 18:41:15 +01:00
Oliver Blanthorn
304e5941bb
Cheer up linter 2023-12-12 19:32:07 +01:00
Oliver Blanthorn
72dfbddf3f
release 1.24.0 2023-12-12 19:17:17 +01:00
Oliver Blanthorn
916bd01e73
Rejig donations text on new tab 2023-12-12 19:17:17 +01:00
Daniel Caixinha
1e0fdf43a3
Make tabgrab and tabpush move to next tabgrab
Now `tabgrab` and `tabpush` will move the tab next to the current tab, except if
the `tabopenpos` setting is set to `"last"`.

In order to make `tabpush` work, I had to create an additional function to get
the active tab for a given window ID.
2023-12-12 11:09:13 +00:00
Oliver Blanthorn
b5507f3b80
Stop text2qr overflowing past window dimensions 2023-12-04 13:02:46 +01:00
Dmitrii Pshonko
a2f4d942dc Add functions to move cursor up and down in text areas
Functions were extracted from @GHolk config, many cudos for him!
2023-12-04 01:12:16 +03:00
Oliver Blanthorn
f13f16cc5d
Amend Memrise links (#4231) 2023-11-20 15:25:56 +01:00
Oliver Blanthorn
c956c3fcf4
Revert "Remove references to broken Memrise course #4231"
This reverts commit 36b02d5a29.
2023-11-20 15:23:07 +01:00
Oliver Blanthorn
36b02d5a29
Remove references to broken Memrise course #4231 2023-11-20 13:32:49 +01:00
Oliver Blanthorn
122ae80d46
Merge pull request #4821 from GHolk/source-clipboard
allow source tridactylrc from clipboard or string arguments
2023-11-20 11:40:48 +00:00
Oliver Blanthorn
f968dad4bf
Merge pull request #4842 from petoncle/keep-default-hints
Exclude default hints from hint -pipe
2023-11-19 15:03:11 +00:00
Oliver Blanthorn
e6b1c0d412
Fix typo 2023-11-19 14:18:41 +01:00
petoncle
5cfe460a81 Exclude default hints from hint -pipe
-pipe is the flag other than -c for which default hints should be excluded
2023-11-15 16:12:18 +01:00
Oliver Blanthorn
81f111f14b
Merge pull request #4351 from GHolk/urlparent-ignore-more
More options for urlparent to ignore fragment, search and index.html
2023-11-13 11:13:21 +00:00
gholk
b30e2b105e
Run pretty as git hook require
I do not want the prettify and the feature change inside a
same commit, so this is a commit contain only the prettify.
2023-11-13 11:57:36 +01:00
gholk
e375417cd4
Change urlparentignoreindexhtml into urlparentignorepathregexp
Make user be able to customize the path to remove before
go to the parent path.
2023-11-13 11:56:15 +01:00
gholk
dbcc21c425
Add default values and docs for new urlparent options
All default values are set to false to keep the behavior unchanged.
Also correct the typescript type error.
2023-11-13 11:56:15 +01:00
Gold Holk
b79aee8726
Make excmd urlparent use new getUrlParent function
Rewrite the config reading with a loop.
2023-11-13 11:56:15 +01:00
Gold Holk
401a36869d
urlparent ignore search fragment and index.html
replace trailingSlash with the option dict.
option contain trailingSlash, ignoreFragment, ignoreSearch and ignoreIndexHtml.
If `ignore*` present, remove it will not cause count decrement.
2023-11-13 11:56:09 +01:00
Amir Hossein
9eac96eb12
Fix command name 2023-11-09 23:10:08 +03:30
Gold Holk
e4b453f99d
Reword ex command source docs
Co-authored-by: Oliver Blanthorn <freedom4cows@gmail.com>
2023-11-07 20:10:53 +08:00
gholk
01df272126 allow source tridactylrc from clipboard or string arguments
Add `--strings` and `--clipboard` flags.
2023-11-04 15:33:39 +08:00
petoncle
ba977dc6ba Remove commandline_content.focus() 2023-10-31 14:48:52 +01:00
petoncle
ae5db07df0 Rename buffered_page_keys message to stop_buffering_page_keys 2023-10-31 14:19:18 +01:00
petoncle
7ee8efc5af Wait for commandline_frame message listener to be set up before trying to send messages from content process 2023-10-31 11:55:14 +01:00
petoncle
8f6acd27ca Also start buffering of page keys with fillcmdline_notrail 2023-10-30 19:26:55 +01:00
petoncle
01b2ba8516 Consume page key buffer even when clInput is not focused 2023-10-30 17:35:28 +01:00
petoncle
38252b1388 Record buffering duration 2023-10-30 17:29:54 +01:00
petoncle
6c0d4d7973 Stop buffering keys after 5s in the event clInput is never focused 2023-10-30 16:54:59 +01:00
petoncle
7f6d8603b2 Replace let with const 2023-10-30 14:46:25 +01:00
petoncle
3f252ddf45 Move common keyboardEvent stopping logic into KeyCanceller 2023-10-30 11:48:04 +01:00
petoncle
270aafb5f5 Replace one comment with TODO and add @hidden annotation for clInputValueChanged() 2023-10-30 11:40:28 +01:00
petoncle
fbc16a57f3 Make command optional in messageOwnTab to be in line with messageTab 2023-10-30 11:34:40 +01:00
petoncle
50f4288ffc Extract methods bufferPageKeyForClInput and consumeBufferedPageKeys 2023-10-30 09:58:55 +01:00
petoncle
6b620276b6 Clean up logs and lets 2023-10-29 23:33:46 +01:00
petoncle
3d5576bb73 Clean logs and move code around 2023-10-29 20:41:48 +01:00
petoncle
c3c12df8cb Add missing buffered_page_keys message type 2023-10-29 20:05:24 +01:00
petoncle
880c8a1d86 Use debug log level instead of info 2023-10-29 20:05:24 +01:00
petoncle
580f48446d Fix typo I've introduced in fillcmdline_notrail 2023-10-29 20:05:24 +01:00
petoncle
d7f0435a5a Simplify page key buffer consumption 2023-10-29 20:05:24 +01:00
petoncle
dbe5a8e8a6 Make commandline process request buffered page keys from page process 2023-10-29 20:05:24 +01:00
petoncle
6b61b69455 Send all keys typed in content page instead of just one key
Tab messages are not always received in order
2023-10-29 20:05:24 +01:00