Opened 5 years ago

Closed 5 years ago

#1441 closed change (fixed)

Let the browser resolve URLs instead doing it ourselve

Reported by: sebastian Assignee: sebastian
Priority: P4 Milestone: Adblock-Plus-1.8.6-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: greiner Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5168731525218304

Description

Background

The functions relativeToAbsoluteUrl()and normalizeURL(), as used by the "Block Element" dialog and the request blocking code for Safari, aim to mimic the way the browser resolves URLs. This approach has following problems:

  1. The way it is currently implemented is incorrect (e.g. subsequent slashes are stripped, which Chrome doesn't do).
  2. The behavior is inconsistent with cases where the browser resolves the URL itself (e.g. when we retrieve an element's src attribute).
  3. This code adds a fair amount of complexity and is potentially slower than letting the browser resolve the URL by itself.

What to change

Get rid of relativeToAbsoluteUrl()and normalizeURL(). And use a temporary <a> element to resolve URLs via its href attribute instead.

Change History (3)

comment:1 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 5 years ago by greiner

  • Cc greiner added

comment:3 Changed 5 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.