Quantcast

File URL To Chrome/Resource URL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

File URL To Chrome/Resource URL

Edmond Begumisa
Hello all,

I'm working on an extension to link Venkman to Komodo with the aim of  
providing local and remote debugging of XULRunner applications. Small  
question...

nsIChromeRegistry::convertChromeURL and nsIResProtocolHandler::resolveURI  
provide a convenient way of getting a local file path from chrome:* and  
registry:* URIs. Anyone know of an equally easy way of doing the opposite?

That is, finding the first chrome: or resource: URI resolving to a  
particular local file: URI?

I'm currently painfully walking through the ChromeML directory service,  
reading manifests from disk, parsing them, then doing regex trickery to  
construct a dictionary of file URIs to compare to but I'm sure someone  
must have already found an easier way deep in the Mozilla code.

Thanks in advance.

- Edmond -

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: File URL To Chrome/Resource URL

Benjamin Smedberg
On 12/29/2011 10:06 AM, Edmond Begumisa wrote:
>
> nsIChromeRegistry::convertChromeURL and
> nsIResProtocolHandler::resolveURI provide a convenient way of getting
> a local file path from chrome:* and registry:* URIs. Anyone know of an
> equally easy way of doing the opposite?
>
> That is, finding the first chrome: or resource: URI resolving to a
> particular local file: URI?
The chrome registry does not expose a list of chrome packages, so no,
there is currently no builtin way to do this. I'd accept a patch which
hands back a list of the current set of chrome package mappings.

The resource registry is even more "interesting" because there are cases
where resource mappings are looked up dynamically (from the directory
service) and so we don't even know the list of resource mappings until
somebody tries to load from them.

--BDS

_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: File URL To Chrome/Resource URL

Edmond Begumisa
On Fri, 30 Dec 2011 02:41:31 +1100, Benjamin Smedberg  
<[hidden email]> wrote:

> On 12/29/2011 10:06 AM, Edmond Begumisa wrote:
>>
>> nsIChromeRegistry::convertChromeURL and  
>> nsIResProtocolHandler::resolveURI provide a convenient way of getting a  
>> local file path from chrome:* and registry:* URIs. Anyone know of an  
>> equally easy way of doing the opposite?
>>
>> That is, finding the first chrome: or resource: URI resolving to a  
>> particular local file: URI?
> The chrome registry does not expose a list of chrome packages, so no,  
> there is currently no builtin way to do this.

Too bad.

> I'd accept a patch which hands back a list of the current set ofchrome  
> package mappings.
>

What I have is all JavaScript in form of a Venkman plugin + Komodo  
Extension :(

I'll see if I can find the time to port the registry part when it's all  
done.

> The resource registry is even more "interesting" because there are cases  
> where resource mappings are looked up dynamically (from the directory  
> service) and so we don't even know the list of resource mappings until  
> somebody tries to load from them.

Ahh, I see, and there's also nsIResProtocolHandler::setSubstitution to  
deal with.

Luckily this is not a problem for my case because the reverse resolving is  
only needed on the editor side not the debugger/XULRunner side. I figure  
if the editor has the manifests in it's registry, resolves currently open  
local files, then sends the resource URI to Venkman, Venkman should be  
able to set breakpoints etc in 95% of the cases.

Thanks.

- Edmond -



>
> --BDS
>


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Loading...