Bind the pushState and replaceState to history
so they will not lost their this.
Except the this binding problem, I'm not sure whether
this URI change event code will work.
In original implementation, a script tag will leave in html,
and the bookmarklet in URL Encoding will not work.
Moreover, if bookmarklet return a string after evaluation,
the string should replace current page's html content.
One can execute bookmarklet by assign it to `window.location.href`,
but it does not work in add-on's context,
so I assign it with `window.eval()`.
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
This command lets you jump to an arbitrary selector. It has completions
that give you a list of elements you may jump to. This list defaults to
heading elements but is configurable through the 'gotoselector'
configuration option.
This is required for the proxy permission. FF ESR has been
at this version since September 2020 so we're probably safe
to increment it without too much drama.
(Hat-tip to the mozilla linter for pointing this out.)
Issue #2690
Rather than delete the statusIndicator span, apply the TridactylInvisible class. This class includes pointer-events:none, which prevents conditional overlap with the statusIndicator EventListener "mouseenter".