Re: [OSM-dev] detect running JOSM from web pages
On Thu, Jul 29, 2010 at 01:03:52AM +0200, Stephan Knauss wrote: I extended JOSM RemoteControl to provide protocol version information. Besides the possibility for clients to choose a compatible command set this enables web pages to query for a running JOSM. Because of restrictions due to same origin policy this was not possible with the existing plugin. RemoteControl now implements CORS (simple requests without preflight) as well as jsonp for the version check. I implemented a live demo on the cuisine map. In the upper right corner will be an edit button in case a running RemoteCotnrol is detected. http://toolserver.org/~stephankn/cuisine/ The new API command is documented on the wiki: http://wiki.openstreetmap.org/wiki/JOSM/Plugins/RemoteControl Hope somebody considers this useful. I don't like the idea that every web page can now find out whether I run JOSM and which version it is. The CORS stuff in the plugin should at least be optional (and the default should be OFF)! Jochen -- Jochen Topf joc...@remote.org http://www.remote.org/jochen/ +49-721-388298 ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] detect running JOSM from web pages
Am 29.07.2010 01:03, schrieb Stephan Knauss: Hope somebody considers this useful. That's pretty cool! Thank you! Peter ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] detect running JOSM from web pages
Jochen Topf wrote: On Thu, Jul 29, 2010 at 01:03:52AM +0200, Stephan Knauss wrote: I extended JOSM RemoteControl to provide protocol version information. I don't like the idea that every web page can now find out whether I run JOSM and which version it is. Thank you for pointing this out. Actually various techniques exist to detect open ports. You can google for JavaScript port scanners to get an idea how this works. So by installing RemoteControl it is already possible (and was in the past). I added this to the wiki, so people installing the plugin should be aware. As the plugin is not shipped by default I assume providing an external interface is the reason people actually install it. Providing a defined interface does not increase the risk. You might have misunderstood the version information as well. It does not report the version of JOSM. Not even the version of the plugin. I did add a version to the interface. That's why it's called protocol version. Using a versioned protocol it is possible to have additions to an interface and keep existing applications functional. Think of a web-page adding not only nodes but also ways. That might be included in protocol 1.1. So the page can detect the capabilities of a client and offer the extended functionality only to users having a recent plugin. As some might still not feel comfortable of web pages reading the protocol version in addition to knowing of the open port I made the plugin aware of the permission properties. Default behaviour is the same as for existing actions. Stephan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] detect running JOSM from web pages
On 29 July 2010 18:07, Stephan Knauss o...@stephans-server.de wrote: I did add a version to the interface. That's why it's called protocol version. Wouldn't it be better to just ask about capabilities, then you could in theory, turn capabilities on or off depending on your circumstance or preferences, rather than having the capabilities fixed. ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] detect running JOSM from web pages
John Smith wrote: On 29 July 2010 18:07, Stephan Knauss o...@stephans-server.de wrote: I did add a version to the interface. That's why it's called protocol version. Wouldn't it be better to just ask about capabilities, then you could in theory, turn capabilities on or off depending on your circumstance or preferences, rather than having the capabilities fixed. if you think of the commands as capabilities then we have that already. In the preferences you can turn on or off each command. Currently there is no command to query these settings. A client has to try and evaluate error codes. In theory the version command could be used for that as well. Adding a version to the signature of each command as well. For what RemoteControl currently offer I think the interface in it's existing version is fine. Future changes might lead to a versioning of these signatures. Not over-engineering the interface right now. Stephan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] detect running JOSM from web pages
Jochen Topf wrote: I don't like the idea that every web page can now find out whether I run JOSM and which version it is. The CORS stuff in the plugin should at least be optional (and the default should be OFF)! +1 Please make it configurable via options whether informations are sent to the WWW/a server or not. Thanks, Michael. ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
[OSM-dev] detect running JOSM from web pages
Hi, I extended JOSM RemoteControl to provide protocol version information. Besides the possibility for clients to choose a compatible command set this enables web pages to query for a running JOSM. Because of restrictions due to same origin policy this was not possible with the existing plugin. RemoteControl now implements CORS (simple requests without preflight) as well as jsonp for the version check. I implemented a live demo on the cuisine map. In the upper right corner will be an edit button in case a running RemoteCotnrol is detected. http://toolserver.org/~stephankn/cuisine/ The new API command is documented on the wiki: http://wiki.openstreetmap.org/wiki/JOSM/Plugins/RemoteControl Hope somebody considers this useful. Stephan ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev