URLs that contain more than one # are not detected as URLs and when entered in the URL bar open are search request instead.
http://example.com/## and press enterhttp://example.com/## The webpage http://example.com/## should open.
A search is performed by the user's default search engine with the search term http://example.com/##.
The reason this is important is that some services use multiple # in their URL. Most prominent candidate is Matrix which uses # for room names. So entering:
will also result in a search instead of opening the page.
┆Issue is synchronized with this Jira Task
➤ Ashley Thomas commented:
Let's timebox this to 2 to start
@dnarcese
I have raise PR for this please take a look
https://github.com/mozilla-mobile/firefox-ios/pull/7491
Verified fixed on 29.0 (2848).
I disagree. It's only partially fixed on 29.0 (2860).
Opening https://chat.mozilla.org/#/room/#general:mozilla.org by tapping the link works. However copying https://chat.mozilla.org/#/room/#general:mozilla.org, pasting it into the address bar and pressing enter initiates a websearch instead of opening the link. Same with http://example.com/##
When escaping one # with %23, e.g. https://chat.mozilla.org/#/room/%23general:mozilla.org the link opens as it should.
I'm not sure how much Matrix is at fault due to disobeying webspec by using multiple # in their URLs and how much Firefox iOS should do to support this.
@GeckoEidechse the reason it does not work is because url.replacingOccurrences(of: "#", with: "%23", range: start.. this would fix it Reverting the last commit (16eaf82610cf4d2d4108bff6297aff453a3c670a) would fix it.
var ranges: [Range
while start <= url.endIndex,
let range = url.range(of: "#", range: start.. ranges.append(range)
start = range.upperBound
}
for range in ranges {
url.replaceSubrange(range, with: "%23")
}
@dnarcese, @SimonBasca
Thanks
hm I just tested with the latest commit and copying and pasting those urls work fine for me.
Oh, it's because this fix hasn't yet landed in release!