Commit graph

103 commits

Author SHA1 Message Date
Oliver Blanthorn
2016839df5
Fix prettier niggles 2023-04-06 17:54:44 +02:00
Tushar
e1b0b7da75 Allow comments in multiline RC file commands. Fixes issue #4555
Signed-off-by: Tushar <tusharbarman123@gmail.com>
2023-04-02 11:22:40 +05:30
Oliver Blanthorn
09172391a5
Add jsua for --mode=browser binds
Works like jsb but preserves the 'user action' so
it can be used to open/close the sidebar, open
downloaded files etc.

Example usage:

`:bind --mode=browser <C-.> jsua browser.sidebarAction.close()`
2023-03-22 14:43:17 +01:00
Oliver Blanthorn
c77bf89d0c
Add sidebartoggle for --mode=browser binds #4640 2023-03-22 14:37:09 +01:00
gholk
3f5d0e81cb Fix unsupported extraSpecInfo passed to webRequest event
`browser.webRequest.on*.addListener` will throw errors if
unsupported extraSpecInfo passed.
We pass the extraSpecInfo for onBeforeRequest for all events,
and add more info in previous release.
Then, some user reported onBeforeRequest event stop working.

We will pass all supported extraSpecInfo for different event
in this commit.
2023-01-01 20:46:12 +08:00
gholk
eed0f18f31
Fix autocmddelete cannot remove webrequest event handler
Original code will overwrite the whole object if the same event
is regist even in different url pattern.

E.g:

```
autocmd BeforeRequest https://*/*?handler1 e=>({cancel:true})
autocmd BeforeRequest https://*/*?handler2 e=>({cancel:true})

" this will throw an error
autocmddelete BeforeRequest https://*/*?handler1
```
2022-12-31 18:06:21 +01: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
14aa92856b
Use platform specific defaults and rename settings 2022-04-25 11:45:00 +02:00
Babil G. Sarwar
24b684330d
Add illegal character sanitisation in filename
Firefox's download API [0] currently does not support invalid characters
in the "saveAs" value, and the following error is thrown if download
filename contains illegal character(s). The issue has been reported to
the Firefox team, and currently it is in "WONTFIX" status [1].

  "filename must not contain illegal characters"

The issue prevents Tridactyl from downloading files from URLs with
certain "illegal" characters, e.g. ":" (colon), that are valid for URLs,
but are rejected in the filenames by the underlying OS's file system.

The default behaviour for operating systems like Mac is to replace the
invalid character(s) with "space" when saving the file to the disk.

The patches here implement basic filename sanitisation support by
introducing the following three configuration parameters in config.ts:

  - illegalfilenamechars
  - illegalwindowsfilenames
  - illegalfilenamereplacement

Essentially, if the "illegalfilenamechars" are found in the downloaded
filename, these characters are replaced by the
"illegalfilenamereplacement" value. The same logic is applied to each of
the comma-separated "illegalwindowsfilenames" values; if any of these
names matches the "saveAs" file-name, the file-name is suffixed with the
"illegalfilenamereplacement" value.

[0] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads/download
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1390473
2022-02-27 15:38:28 +11:00
Oliver Blanthorn
dbd5bd4299
Investigate #3772: switch back to ramda 2021-06-19 17:58:57 +02:00
Oliver Blanthorn
f1e7b3cbf8
Revert "Swap eval for an indirect one"
This reverts commit 9db4cb9e04.
2021-06-08 13:50:45 +02:00
Rummskartoffel
9db4cb9e04
Swap eval for an indirect one
This makes esbuild happier. Also let prettier
mess with some formatting
2021-06-04 17:24:04 +02:00
Rummskartoffel
238ae4cb03 Revert "Appease esbuild warnings about direct eval() by using window.eval()"
This reverts commit 0e46eeca42.
2021-06-04 00:28:54 +02:00
Rummskartoffel
0e46eeca42 Appease esbuild warnings about direct eval() by using window.eval()
See also https://esbuild.github.io/content-types/#direct-eval.
Bare ("direct") eval() evaluates in the local scope where it is called
instead of the global scope, which can cause problems (which is why
esbuild complains). Our uses of it don't need local scope, so we can
safely switch to window.eval().
2021-05-07 21:03:11 +02:00
Oliver Blanthorn
77dee7869a
Merge branch 'master' into quicker_ramda 2021-05-02 12:22:48 +01:00
Oliver Blanthorn
5092be9e36
Remove .ts from imports
Webpack supports it but TypeScript does not
2021-05-01 12:57:38 +02:00
Oliver Blanthorn
9fe79529c7
WIP: swap ramda for rambda
It supports TS a bit better and is a bit quicker.

But it has fewer functions
2021-04-29 17:52:41 +02:00
Oliver Blanthorn
8a5f6dcb65
Cheer up prettier 2021-04-29 17:52:14 +02:00
Oliver Blanthorn
3d39ccb07a
Fix a real linting error 2021-03-16 22:07:09 +01:00
Oliver Blanthorn
813a1d2c34
Follow loose error message conventions 2021-03-13 12:55:09 +01:00
Oliver Blanthorn
f2bc23c102
Simplify error handling 2021-03-13 12:55:09 +01:00
Oliver Blanthorn
e8aef3eb99
Move success message to interactive code 2021-03-13 12:55:09 +01:00
Babil G. Sarwar
9cd88c9dc5
Improve compatiblity for Python and Nim Messengers 2021-03-13 12:55:09 +01:00
Babil G. Sarwar
17f45adda0
Show user-friendly messages at saveas completion 2021-03-13 12:55:08 +01:00
Babil G. Sarwar
cb32af182b
Add --overwrite and --cleanup options to 'saveas' 2021-03-13 12:55:08 +01:00
Rummskartoffel
573ab2b790
Re-add missing return 2021-02-20 12:17:50 +01:00
Rummskartoffel
61e6e9263c Use Record for useractions 2021-02-20 11:34:11 +01:00
Rummskartoffel
3391e5beeb Fix a few trivial no-unsafe-call errors 2021-02-19 18:34:49 +01:00
Oliver Blanthorn
a2bf537094
Extract getTridactylTabs from user_actions 2021-01-28 14:27:16 +01:00
Oliver Blanthorn
89a3dfc250
Fix #3148: allow themes to be loaded from URLs 2021-01-26 22:32:40 +01:00
Oliver Blanthorn
a3d9f5c942
Switch to no-unused-vars-experimental
`no-unused-vars` doesn't work for types so we had to switch
2020-12-16 16:48:57 +01:00
Oliver Blanthorn
88202b526e
Fix #3100: skip # comments in RCs 2020-12-13 22:16:48 +01:00
Oliver Blanthorn
f286bfe1e2
Fix #2775: add option to not fiddle with sidebar on C-, 2020-09-24 14:39:51 +01:00
Oliver Blanthorn
0cefbbbe64
Add downloadsskiphistory to another download call 2020-07-30 14:15:58 +01:00
Oliver Blanthorn
9ef6d77dd9
Add downloadsskiphistory setting for gigip 2020-07-30 14:01:30 +01:00
Oliver Blanthorn
b790f11903
Fix lint regression caused by using Ramda types 2020-07-15 21:27:17 +01:00
Oliver Blanthorn
7ab7c0b8a3
Catch promise errors correctly 2020-07-07 11:30:27 +01:00
Oliver Blanthorn
0548153aac
Fix escapehatch in non-useraction contexts 2020-07-06 17:30:29 +01:00
Oliver Blanthorn
112e392d38
Focus page if address bar is focused on :escapehatch
This works around a Mozilla bug by quickly opening and closing the
sidebar.
2020-07-06 17:17:19 +01:00
Oliver Blanthorn
09e19896cf
Grasp the nettle: run prettier on all of src 2020-07-01 18:38:02 +01:00
Oliver Blanthorn
f3877dacfc
Add autocmds for web requests 2020-07-01 12:51:50 +01:00
Oliver Blanthorn
dee3b7e6c1
Re-enable require-await 2020-06-19 13:48:22 +01:00
Oliver Blanthorn
eac06ae39a
Re-enable no-empty-function 2020-06-18 22:35:24 +01:00
Oliver Blanthorn
d4d1526d3d
Fix #2124: :mkt now works
(Disclaimer: it works on Linux. On my machine.)
2020-04-28 10:46:47 +01:00
Oliver Blanthorn
27572a5914
Revert "Merge branch 'config_no_onchanged'"
This reverts commit fe39c3e43a, reversing
changes made to 9ceb56595c.
2020-02-20 10:23:56 +00:00
Oliver Blanthorn
dc6c1b4c40
Remove delay between RC lines
Hopefully it isn't needed any more.
2020-02-18 21:12:08 +00:00
Oliver Blanthorn
266988344e
Merge branch 'typed-background-messaging' 2019-11-27 09:32:59 +00:00
Saul Reynolds-Haertle
1676d9d34f Teach config-rc to string-join lines ending with \
This makes longer invocations _much_ more tolerable, which is super
useful for things like replacing long (racy) sequences of
`autocontain` directives with stuff like the following:

```
js window.tri.config.set('autocontain', Object.fromEntries([ \
  ['youtube\.com', 'sreyn@goog'], \
  ['www\.google\.com', 'sreyn@goog'], \
  " ...
].map(([k, v]) => ['^https?://[^/]*' + k + '/', v])))
```
2019-11-16 20:42:56 -08:00
Oliver Blanthorn
0895b268c0
Mitigate our race conditions with a speed limit
I am not proud of this but it seems to work
2019-11-07 19:19:33 +00:00
Jakub Okoński
a8b740b1bd Add strong typing to background messages 2019-10-26 21:55:59 +02:00