Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

my own url protocol in link

5 views
Skip to first unread message

Dmitry

unread,
Nov 26, 2009, 5:02:29 AM11/26/09
to
I want in my xul program make links like <a
href="res://some_resource#1231">Show me something local</a> and to make
handler for this (javascript function), is it possible?


DDD

unread,
Dec 7, 2009, 10:26:20 PM12/7/09
to
On Nov 26, 6:02 pm, "Dmitry" <d...@domokom.ru> wrote:
> I want in my xul program make links like  <a
> href="res://some_resource#1231">Show me something local</a>  and to make

<a onclick="doMyfile();" .../>

> handler for this (javascript function), is it possible?

If just wanna open it as you dblclick it in the OS shell. You just
need a script to run the nsIFile.
Such as

function doMyfile() {
var file = Components.classes["@mozilla.org/file/local;
1"]
.createInstance
(Components.interfaces.nsILocalFile);
file.initWithPath("C:\\Program Files\\...\
\notepad.exe");
file.launch();
}

Else please refer to
MSDN:http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx
The following refs are from Mozilla
1:http://kb.mozillazine.org/Register_protocol
2:http://kb.mozillazine.org/Talk:Register_protocol
3:https://developer.mozilla.org/en/Web-based_protocol_handlers
4:http://support.mozilla.com/en-US/kb/The+protocol+is+not+associated
+with+any+program

0 new messages