Open Bug 1536391 Opened 6 years ago Updated 3 years ago

Base URL is ignored when copy/open links in HTML attributes

Categories

(DevTools :: Inspector, defect, P3)

65 Branch
defect

Tracking

(Not tracked)

People

(Reporter: lorenzo.stanco, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

Open the inspector on a web page with a <base href> that modifies the default base URL of the document. Now pick, for example, an <img src> with an URL relative to the base: middle-click or right-click the URL and choose to open in a new tab or copy in the clipboard.

Actual results:

The URL that is opened or copied is incorrect, since is created by merging the document URL and the HTML attribute, ignoring the overridden base URL.

Expected results:

The URL should have been created by merging the correct base URL and the relative URL in the HTML attribute.

Hi Lorenzo, thanks for filing.
Would you mind providing a test case (a sample HTML page or URL) to reproduce this problem?

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(lorenzo.stanco)
Priority: -- → P3
Attached image byzanz-record.gif
Flags: needinfo?(lorenzo.stanco)

(In reply to Patrick Brosset <:pbro> from comment #1)

Would you mind providing a test case (a sample HTML page or URL) to reproduce this problem?

Sure, here it is: https://www.lorenzostanco.com/stack/ffbug2.html

I attached a GIF showing the incorrect behaviour (Italian locale, but that's it).

Seems like the URL resolver in the Inspector actor should make use of document.baseURI instead of document.location.href.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: