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.
I would suggest resolving this as a duplicate of Bug 962326.
Yep, looks like same patch with some updates.