Results 1 to 9 of 9

Thread: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

  1. #1
    Join Date
    Sep 2006
    Beans
    24

    HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    I ran into a problem where no matter what browser I set in Unity, Lotus Notes 8.5.2 always used Firefox. There is one solution involving usage of xdg-mime, but it appears that for me that was not enough. That solution is described here.

    The short answer is: the system's default browser is Firefox, and the user's default is Chromium. Lotus seems to be combining the system and user defaults, and determining that both of these browsers can open HTML, yet it picks Firefox (the system default) over Chrome, disregarding the user's settings.

    (Note that my conclusions are theoretical, as they are inferred from strace output, which isn't able to tell us the intention behind what Notes is doing.)

    Anyway, the workaround is to change the system's default browser. Whether this is acceptable for your scenario is up to you.

    1. edit this file:

    Code:
    # sudo vi /usr/share/applications/defaults.list
    Change this line:

    Code:
    text/html=firefox.desktop
    to:

    Code:
    text/html=chromium-browser.desktop
    2. Restart notes.


    This workaround may also work for regular (classic) GNOME desktops as well, although I have not tested it.

    ---

    Here's how I figured this out.

    1. Started up notes. This kicks off a few processes:

    Code:
    /opt/ibm/lotus/notes/notes /authenticate
    
    nsdexec 17432 /home/myself/lotus/notes/data
    
    /opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.2.2.20100729-1241/linux/x86/notes2 --launcher.suppressErrors -nosplash -nl en_US -dir ltr -NPARAMS /authenticate -RPARAMS -name IBM Lotus Notes -personality com.ibm.rcp.platform.personality -product com.ibm.rcp.personality.framework.RCPProduct:com.ibm.notes.branding.notes -data /home/myself/lotus/notes/data/workspace -configuration /home/myself/lotus/notes/data/workspace/.config -plugincustomiz....
    That last one is the one we care about.

    2. In a terminal, kicked off strace on the above child notes process:

    Code:
    strace -p 16407 &> ~/notessucks.txt

    3. Went to the Notes UI and clicked a http link. Quit notes.

    4. Inspected the strace file I piped output to (notessucks.txt). Here's where the magic happens. And by "magic", I mean whatever messed up method Notes decides it wants to screw up your user experience.


    First, it reads the system wide default apps:

    Code:
    stat64("/usr/share/applications/defaults.list", {st_mode=S_IFREG|0644, st_size=8882, ...}) = 0
    open("/usr/share/applications/defaults.list", O_RDONLY|O_LARGEFILE) = 162
    My guess is that from here, it sees that firefox is used to open text/html files, because it closes the file right after it finds this out:

    Code:
    open("/usr/share/applications/defaults.list", O_RDONLY|O_LARGEFILE) = 162
    fstat64(162, {st_mode=S_IFREG|0644, st_size=8882, ...}) = 0
    read(162, "[Default Applications]\nvideo/mp4"..., 4096) = 4096
    read(162, "audio=totem.desktop\napplication/"..., 4096) = 4096
    read(162, "http=firefox.desktop\ntext/abiwor"..., 4096) = 690
    read(162, "", 4096)                     = 0
    close(162)                              = 0
    Next, also watches the user's default apps folder:

    Code:
    inotify_add_watch(161, "/home/myself/.local/share/applications", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = 1
    That folder is where the user's browser preference is stored:

    Code:
    myself@myhost:~$ ls -l /home/myself/.local/share/applications/
    total 4
    -rw-r--r-- 1 myself myself 405 2011-08-16 15:50 mimeapps.list
    myself@myhost:~$ cat /home/myself/.local/share/applications/mimeapps.list
    
    [Default Applications]
    x-scheme-handler/http=chromium-browser.desktop
    x-scheme-handler/https=chromium-browser.desktop
    text/html=chromium-browser.desktop
    x-scheme-handler/about=chromium-browser.desktop
    x-scheme-handler/unknown=chromium-browser.desktop
    text/xml=chromium-browser.desktop
    
    [Added Associations]
    x-scheme-handler/http=chromium-browser.desktop;
    x-scheme-handler/https=chromium-browser.desktop;
    Later, it sees how it's supposed to handle opening firefox:

    Code:
    open("/home/myself/.local/share/applications/firefox.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/share/gnome/applications/firefox.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/local/share/applications/firefox.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/share/applications/firefox.desktop", O_RDONLY|O_LARGEFILE) = 162
    And then does the same for chromium:

    Code:
    open("/home/myself/.local/share/applications/chromium-browser.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/home/myself/.local/share/applications/chromium/browser.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/share/gnome/applications/chromium-browser.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/share/gnome/applications/chromium/browser.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/local/share/applications/chromium-browser.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/local/share/applications/chromium/browser.desktop", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/share/applications/chromium-browser.desktop", O_RDONLY|O_LARGEFILE) = 162

    Now, I'm guessing, it knows that both can open the link I then click on, but for whatever reason, it picks firefox. (I couldn't find the actual exec call in the output, but I obviously saw the firefox app get kicked off. The closest I found was the snippet below.)

    Code:
    getcwd("/home/opt/ibm/lotus/notes", 4096) = 26
    access("/home/opt/ibm/lotus/notes/http://www.terracotta.org/products", F_OK) = -1 ENOENT (No such file or directory)
    Anyway, hope that helps someone else. Feedback welcome.

  2. #2
    Join Date
    Jul 2011
    Beans
    2

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    Hi twelve17,

    Thanks for posting this, I have been trying to get notes to open links in Chrome for a while now. The solution you posted worked for me.

    One point of difference was that my /usr/share/applications/defaults.list was slightly different than yours:

    Mine:
    Code:
    text/html=firefox.desktop;google-chrome.desktop
    Yours:
    Code:
    text/html=firefox.desktop
    I changed mine to:
    Code:
    text/html=google-chrome.desktop;firefox.desktop
    and that did the trick.

    I suppose I could have removed firefox.desktop from text/html, however I was curious to see what happened. Now I know. Notes picks the first in the list.

  3. #3
    Join Date
    Jul 2011
    Beans
    2

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    Better yet, I replaced all occurrences of:

    Code:
    firefox.desktop;google-chrome.desktop
    with

    Code:
    google-chrome.desktop;firefox.desktop
    in

    Code:
    /usr/share/applications/defaults.list

  4. #4
    Join Date
    May 2006
    Beans
    9

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    Thank you for the writeup. It is great that you included the steps to figure out the solution. If more people did this, it would allow more of us in the community to add to our bag of tricks and apply similar tools and logic to solving more of our issues with software on Linux. I had been searching for this solution for months!

  5. #5
    Join Date
    Sep 2006
    Beans
    24

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    @luxor, no problem! If for no other reason, I write it out for myself for future reference.

  6. #6
    Join Date
    Jan 2007
    Beans
    25

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    Mine still doesn't work. I've updated my personal mimeapps.list and the /usr one. However, I also don't see anything in an strace that indicates it's being pulled as firefox.

    I'm using chromium, so I'm using chromium-browser.desktop.

  7. #7
    Join Date
    Jan 2007
    Beans
    25

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    I figured it out. On my openSUSE 12.1 box running KDE w/ GTK from GNOME 3.2, the stuff to modify resided in:
    /home/<homedir>/.gconf/desktop/gnome/url-handlers

  8. #8
    Join Date
    Oct 2009
    Beans
    27

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    Quote Originally Posted by EclipseAgent View Post
    I figured it out. On my openSUSE 12.1 box running KDE w/ GTK from GNOME 3.2, the stuff to modify resided in:
    /home/<homedir>/.gconf/desktop/gnome/url-handlers
    EclipseAgent, I think you're on to it. But my gconf setting for http/https in url-handlers points to a shell script called sensible-browser. (in /usr/bin). I will look into this (don't have time now) but want to give a bit of time for somebody to reply if they already have an understanding of how this script works and what it provides.

  9. #9
    Join Date
    Oct 2009
    Beans
    27

    Re: HOWTO: Get Lotus Notes 8.5 to open links in Chrome

    Quote Originally Posted by kdford View Post
    EclipseAgent, I think you're on to it. But my gconf setting for http/https in url-handlers points to a shell script called sensible-browser. (in /usr/bin). I will look into this (don't have time now) but want to give a bit of time for somebody to reply if they already have an understanding of how this script works and what it provides.
    Well, I found this post on how to set your default browser using update-alternatives (it updates a script called x-www-browser if I got it right)... Anyway, this page says that sensible-browser CALLS x-www-browser. I don't think that's the case.

    I updated my alternatives for x-www-browser to point to firefox, but when I invoke sensible-browser it still launches chromium. if I invoke x-www-browser, it now launches firefox. Notes seems to be calling sensible-browser, since that is what is stored in my gconf settings. I could of course just change gconf to call firefox.desktop, but I'd rather understand sensible-browser. will look at it after work.

    https://lists.ubuntu.com/archives/ub...er/002628.html

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •