Re: Checking if an nsIURI came from a resource: URL

2018-12-07 Thread Henri Sivonen
On Fri, Dec 7, 2018 at 5:05 PM Dave Townsend  wrote:
>
> This suggests that channel.originalURI should help: 
> https://searchfox.org/mozilla-central/source/netwerk/base/nsIChannel.idl#37

Indeed, getting both nsIURIs from the channel works. Thanks!

-- 
Henri Sivonen
hsivo...@mozilla.com
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Checking if an nsIURI came from a resource: URL

2018-12-07 Thread Dave Townsend
This suggests that channel.originalURI should help:
https://searchfox.org/mozilla-central/source/netwerk/base/nsIChannel.idl#37

On Fri, Dec 7, 2018 at 9:19 AM Henri Sivonen  wrote:

> On Fri, Dec 7, 2018 at 3:23 PM Daniel Veditz  wrote:
> >
> > I'm afraid to ask why you want to treat these differently.
>
> I'd like to make out resource: URLs default to UTF-8 and skip
> (upcoming) detection between UTF-8 and the locale-affiliated legacy
> encoding.
>
> > Do you have a channel or a principal?
>
> I have a channel at a later point, so I could reverse the decision
> made from the nsIURI by looking at the channel before the initial
> decision is acted upon in a meaningful way.
>
> --
> Henri Sivonen
> hsivo...@mozilla.com
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Checking if an nsIURI came from a resource: URL

2018-12-07 Thread Henri Sivonen
On Fri, Dec 7, 2018 at 3:23 PM Daniel Veditz  wrote:
>
> I'm afraid to ask why you want to treat these differently.

I'd like to make out resource: URLs default to UTF-8 and skip
(upcoming) detection between UTF-8 and the locale-affiliated legacy
encoding.

> Do you have a channel or a principal?

I have a channel at a later point, so I could reverse the decision
made from the nsIURI by looking at the channel before the initial
decision is acted upon in a meaningful way.

-- 
Henri Sivonen
hsivo...@mozilla.com
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Checking if an nsIURI came from a resource: URL

2018-12-07 Thread Daniel Veditz
I'm afraid to ask why you want to treat these differently. Do you have a
channel or a principal? By itself nsIURI only describes the url itself, not
its effective origin nor its redirect history.

On Fri, Dec 7, 2018, 8:08 AM Henri Sivonen  It appears that my the time resource: URLs reach the HTML parser,
> their scheme is reported as "file" (at least in debug builds).
>
> Is there a way to tell from an nsIURI that it was expanded from a
> resource: URL?
>
> --
> Henri Sivonen
> hsivo...@mozilla.com
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform