Opened 18 months ago

Last modified 13 months ago

#7296 closed change

Implement hostname extraction using a regular expression — at Initial Version

Reported by: mjethani Assignee:
Priority: P2 Milestone:
Module: Core Keywords:
Cc: greiner Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):



In the extension we use the URL object just to extract the hostname from a URL. This is not very efficient as it must parse the entire URL. Extraction of the hostname can be implemented using a regular expression instead:

let [, hostname] = /(?:[^:]+:)(?:\/\/(?:.*@)?(\[[^\]]*\]|[^:\/]+))?/.exec(url) || [];

What to change

To be determined.

Change History (0)

Note: See TracTickets for help on using tickets.