Modify

Opened 4 weeks ago

Last modified 9 days ago

#23688 new enhancement

[PATCH] Open local url using the os instead of the browser

Reported by: Emvee Owned by: team
Priority: normal Milestone: 24.06
Component: Plugin utilsplugin2 Version:
Keywords: local url 127.0.0.1 Cc:

Description

I have a local python script that listens on a port and accepts a URL like

http://127.0.0.1:8282/qgis_zoom_to?lat=51.5810865&lon=4.5293149

I did put that in the custom URL configuration of the Utilsplugins2 settings as:

http://127.0.0.1:8282/qgis_zoom_to?lat={#lat}&lon={#lon}

And that will open the browser after which the browser will call the local script.
While this is working it has the drawback that it leaves an empty tab open every time you involve this script and this extra browser step adds latency

What this patch does is to check for a local address and if so, open the url using the Java system functionality. This way I see the script is called without involving the browser.

With the current patch, josm will emit a warning if the local system is not handling the request:

2024-05-22 10:25:42.538 SEVERE: Can not open URL http://127.0.0.1:8282/qgis_zoom_to?lat=51.5810865&lon=4.5293149: java.net.ConnectException: Connection refused

Attachments (1)

local_url.patch (1.7 KB ) - added by Emvee 4 weeks ago.

Download all attachments as: .zip

Change History (2)

by Emvee, 4 weeks ago

Attachment: local_url.patch added

comment:1 by Emvee, 9 days ago

Milestone: 24.06

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Emvee.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.