Opened 6 months ago

Last modified 4 weeks ago

#7296 closed change

Implement hostname extraction using a regular expression — at Version 4

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

https://codereview.adblockplus.org/30013574/

Description (last modified by mjethani)

Background

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 (4)

comment:1 Changed 6 months ago by mjethani

  • Blocking 7000 added

comment:2 Changed 6 months ago by mjethani

  • Description modified (diff)

comment:3 Changed 6 months ago by mjethani

  • Description modified (diff)

comment:4 Changed 6 months ago by mjethani

  • Description modified (diff)
Note: See TracTickets for help on using tickets.