java - Writing a custom protocol handler portable on Firefox, Chrome and IE running on Window -
i writing protocol handler launch java application, calling command java -jar myapp '%1'. have implemented chrome , looks work correcly. unfortunately don't have same behavior firefox , ie (weird uh?! x-d )
here implementation.
the protocol named dgh. during first installation application set following keys in windows registry
windows registry editor version 5.00 [hkey_classes_root\dgh] @="url:dghome protocol" "url procol"="" [hkey_classes_root\dgh\defaulticon] @="c:/dghome/iplusconf.exe,1" [hkey_classes_root\dgh\shell] [hkey_classes_root\dgh\shell\open] [hkey_classes_root\dgh\shell\open\command] @="java -jar c:/dghome/pch/lib/pch.teleconsulto.jar \"%1\""
on chrome enough. on firefox, had add configurations in about:config.following mdn on firefox set following
network.protocol-handler.expose.dgh;true network.protocol-handler.external.dgh;true network.protocol-handler.warn-external.dgh;false
in way firefox @ least ask me if want launch application , ask me select one: i don't want that, call command set , advise first time user that:
on ie nothing happens, says can't open web page reference link.
here set of link used test
<a href="dgh://call/open?id='kit1.teleconsulto'">open call kit1.teleconsulto</a> <a href="dgh://teleconsult/start?id='kit1.teleconsulto'"> open teleconsult kit1.teleconsulto</a> <a href="dgh://call/close">close call</a> <a href="dgh://call/end">close client</a> <a href="dgh://stethoscope/start">on phonendo</a>
here references: installing , registering protocol handlers http://msdn.microsoft.com/en-us/library/aa767916%28vs.85%29.aspx
i hope sincerely can me
the problem you're having you're calling jar directly in protocol handler. need invoke java.exe -jar parameter
your registry key should this
windows registry editor version 5.00 [hkey_classes_root\digitalmgi] @="url:digitalmgi protocol" "url protocol"="" [hkey_classes_root\digitalmgi\defaulticon] @="c:\\mycoolicon.ico" [hkey_classes_root\digitalmgi\shell] [hkey_classes_root\digitalmgi\shell\open] [hkey_classes_root\digitalmgi\shell\open\command] @="\"c:\\program files\\java\\jre7\\bin\\java.exe\" -jar \"c:\\mypath\\myjar.jar\" \"%1\""
Comments
Post a Comment