Skip navigation
Taehoon Koo
Currently Being Moderated

is it possible to attach URLHandler for plugin

Nov 15, 2010 8:41 AM

Hi, Guys.

 

I notice Facebook plugin can accept external URL protocol via web browser.

( URL : lightroom://com.adobe.lightroom.export.facebook/%23access_token=147.. .. )

 

Screen shot 2010-11-16 at 1.39.59 AM.png

 

 

Is it possible to attach Custrom URLHandler for my plugin ?

 

I can't find any information about it.

 

If someone know about this, please let me know.

 

Have a nice day.

 
Replies
  • Currently Being Moderated
    Dec 22, 2010 2:03 AM   in reply to Taehoon Koo

    I don't see how.

     

    I mean Lr does not allow low-level access to internet communications, and otherwise what you get is:

     

    LrFtp, and

    LrHttp.

     

    If you cant do it with those, then you cant do it, or at least not directly...

     

    One thing you can do is talk to an external app. So what you could do is write the protocol handler as an external app, and then to send information from a plugin via the custom internet protocol, write a file or pass parameters to the external app. To receive, you could read a file written by the external app.

     

    Thats about all I can think of at the moment.

     

    Well maybe one other idea: use an http wrapper to access a web-app to tunnel, instead of a reglar app.

     

    Rob

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 17, 2012 11:12 AM   in reply to Rob Cole

    Rob just pointed out that LR 3 does now support URL handlers:

     

    http://regex.info/blog/2012-01-17/1926

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 18, 2012 10:24 PM   in reply to John R. Ellis

    It's not documented in SDK, but I've tried it before.

     

    In Info.lua:

     

    URLHandler = "URLHandler.lua",

     

    In URLHandler.lua (or whatever you want), just:

     

    local handler={}

    function handler.URLHandler(url)

    -- handle url here

    end

    return handler

     

    BTW I also tried this for external app communication, but for that specific purpose it was not suitable, because Lightroom takes focus when URL is clicked from browser.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 19, 2012 2:07 AM   in reply to jarnoh

    Just be sure that your code allows for the URL received being surrounded in

    double quotes. Not exactly sure the circumstances/platforms that trigger

    the issue but it is worth catering for it or you could end up with some

    very hard to reproduce bugs being reported.

     

    Thanks,

    Matt

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 5:30 PM   in reply to John R. Ellis

    This seems to work fine on my Win XP system running Firefox as my system default browser.  If I use IE 8, instead, I get an "Internet Explorer cannot display the webpage" diagnostic page when it gets handed my "lightroom://...." callback URL.  Does this mechanism work with IE?  Is it because IE wasn't my default browser when Lightroom was installed?

     

    -Don

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 6, 2012 4:11 PM   in reply to Don McKee

    Hi,

     

    I am wondering if there is some security or privacy setting that is

    stopping IE from responding to the callback? A quick way to check would be

    to temporarily add the originating site to your trusted site zone to see if

    it works then.

     

    On Chrome you are prompted the first time to see whether you want to accept

    URLs with this protocol. I'm guessing this is IE's way of handling the same

    question.

     

    Thanks, Matt

    (Apologies for the brevity - sent from my Android)

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 6, 2012 11:08 PM   in reply to Matt Dawson

    Seems to work just fine if you just permanently dismiss the dialog box, e.g. IE.

     

    I've used this technique in my new cookmarks plugin:

     

    http://www.robcole.com/Rob/ProductsAndServices/CookmarksLrPlugin

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 1:29 PM   in reply to Matt Dawson

    The "lightroom://..." URL works fine in IE if I type it on the address bar, but it doesn't work (i.e. "Internet Explorer cannot display the webpage" error) if it comes in from the internet via an HTTP 302 redirect response.  Per Matt's suggestion, I added the originating site to my "trusted sites" (and even threw in my "lightroom://..." URL for good mesasure), but still no joy.  I guess Rob is having success driving his plug-in from IE, because his stuff is all local (right, Rob?).

     

    So, I'm still curious if anyone has had success using IE to respond to the "lightroom://..." protocol (or any custom protocol, for that matter) when the request originated from the internet.  Anyone?

     

    -Don

     

    (p.s., if anyone's curious, here's a page describing how custom protocols are registered on Windows systems: http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx .  )

     

    Update: Using IE, I discovered that if a user clicks on a link in a remote web page that has a "lightroom://..." URL, or the remote web page contains a

     

    <META HTTP-EQUIV="refresh" CONTENT="0;URL=lightroom://... />

     

    tag, it works.  IE (8 -- haven't tested others) is only choking on the HTTP 302 redirect.  :-(

     

    Message was edited by: Don McKee.  Added update.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 5:02 PM   in reply to Don McKee

    Don,

     

    Thanks for the link.

     

    Yeah - I have had no problems in IE when clicking on links via internet supplied web pages, once Lightroom has been approved as the URL handling agent. Never tried a redirect.

     

    I mean, lightroom:// links are neither local nor remote per se - or should I say they are always "local"...

     

    Rob

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points