Open thobe opened 3 years ago
I've worked around the issue for now with the following:
{
match: ({ url }) => url.host.endsWith("independentaustralia.net"),
url: ({ url }) => {
return {
...url,
host: url.host,
pathname: url.pathname.replace(/\%23.+/g, '')
}
}
}
Note that the workaround assumes that the shortened URL only can contain non-encoded #.
Wouldn't be it easier to use decodeURI(url)
in return? (or something similar)?
I mean it would probably be better to fix the underlying bug...
Personally I'd be fine if Finicky merely resolved URL shorteners in order to decide which browser to use but then still gave the original short URL to the browser.
That would be an excellent solution.
Alternatively, looks like perhaps taking the calls to addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
and adding #
to the .urlQueryAllowed
character set would work?
Describe the bug When a shortened URL contains a fragment identifier (ending with
#
-something), Finicky encodes that#
as%23
, which results in making it part of the actual URL, rather than a fragment.Your configuration Nothing relevant.
To Reproduce Steps to reproduce the behavior:
https://bit.ly/3lsQ95c
through Finicky (e.g. from the command line asopen 'https://bit.ly/3lsQ95c'
)https://github.com/johnste/finicky#table-of-contents
(which is what it does if you enterhttps://bit.ly/3lsQ95c
directly in your web browsers address bar).https://github.com/johnste/finicky%23table-of-contents
, causing a 404 from GitHub.