If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Provide scriptable utility functions to obtain URL bar domain

RESOLVED DUPLICATE of bug 962326

Status

()

Core
Security
RESOLVED DUPLICATE of bug 962326
4 years ago
3 years ago

People

(Reporter: Mike Perry, Unassigned)

Tracking

24 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 833220 [details] [diff] [review]
Patch against FF24.1.1esr

When making various security and privacy decisions about a page, it is often desirable to determine the URI in the location bar for a given sub-document to decide what to do. An easy to use utility function that provides the top-level location URI for an nsIChannel or an nsIDocument is an extremely useful thing to aid in these decisions.

In Tor Browser, we created a single API for this purpose that can take either an nsIChannel or nsIDocument. We resurrected the old mozIThirdPartyUtil.getOriginatingURI() API to use its logic for the channel case, and wrote our own logic for the nsIDocument case.

We chose this implementation because it made error handling simpler (for the case where both a channel and a document are available, but the channel path fails).

It is possible we want to rewrite this to fold in getOriginatingURI rather than resurrect it (since it was removed in Bug 769589), and/or to split it into two utility functions (one for the channel, one for the document). We're open to suggestions.

Updated

4 years ago
OS: Windows 7 → All
Hardware: x86 → All
I would suggest resolving this as a duplicate of Bug 962326.
Flags: needinfo?(mikeperry)

Comment 2

3 years ago
Yep, looks like same patch with some updates.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 962326

Updated

3 years ago
Flags: needinfo?(mikeperry)
You need to log in before you can comment on or make changes to this bug.