twelve17
August 16th, 2011, 09:48 PM
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 (http://biounix.blogspot.com/2010/03/setting-default-browser-for-lotus-notes.html).
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:
# sudo vi /usr/share/applications/defaults.list
Change this line:
text/html=firefox.desktop
to:
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:
/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.i bm.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:
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:
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:
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:
inotify_add_watch(161, "/home/myself/.local/share/applications", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_C REATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNM OUNT|IN_ONLYDIR) = 1
That folder is where the user's browser preference is stored:
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:
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:
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.)
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.
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:
# sudo vi /usr/share/applications/defaults.list
Change this line:
text/html=firefox.desktop
to:
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:
/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.i bm.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:
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:
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:
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:
inotify_add_watch(161, "/home/myself/.local/share/applications", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_C REATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNM OUNT|IN_ONLYDIR) = 1
That folder is where the user's browser preference is stored:
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:
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:
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.)
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.