Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Linux with Firefox
In order to connect to a network share directly from you browser under Linux, you must configure Firefox to handle URL's starting with "smb://". This is done by typing "about:config" in the address line and hitting return. After that you must right-click the list of settings and choose "New -> Boolean" as shown below.
As name you must type: "network.protocol-handler.external.smb" with a value of "true".
After that you must do the same thing over again, but this time choose "New -> String", type the name: "network.protocol-handler.app.smb" with a value of the path to the application you wish to use for browsing network shares. If you use KDE, this will typically be "/usr/bin/konqueror".
I hope this is sufficient detail for someone to give me some ideas for how to solve this problem.
Firefox doesn't support SMB/CIFS. You'll need to use a different application to actually view the network shares. If you use one of the heavier-weight desktop managers (i.e. GNOME or KDE), your graphical file browser probably supports it. If not, there are dedicated applications for SMB browsing or you can mount the share directly.
The instructions you found are for setting up a protocol handler. Protocol handlers do not enable Firefox to display the content itself; instead they tell it what application to launch to handle a specific type of URL. Once you've found an SMB client you like, you can set up a protocol handler so that Firefox launches it when you give it an smb:// URL.
Firefox doesn't support SMB/CIFS. You'll need to use a different application to actually view the network shares. If you use one of the heavier-weight desktop managers (i.e. GNOME or KDE), your graphical file browser probably supports it. If not, there are dedicated applications for SMB browsing or you can mount the share directly.
The instructions you found are for setting up a protocol handler. Protocol handlers do not enable Firefox to display the content itself; instead they tell it what application to launch to handle a specific type of URL. Once you've found an SMB client you like, you can set up a protocol handler so that Firefox launches it when you give it an smb:// URL.
thanks for your reply.
i had the thought that nautilus *was* the smb browser. i am trying to launch nautilus from firefox to open folders on my network. under Windows IE, launching the file manager (explorer) was possible using activex. i want to do the same with Ubuntu using firefox. problem is, of course, firefox doesn't do activex, and there is no equivalent way of launching the native file manger (nautilus in this case) from an HTML anchor link.
which is why i was thinking of using smb shares instead.
anyway, if google desktop search can launch nautilus from firefox, then obviously there is a way of doing this!
If you mount the smb share, you can browse to the mount point using firefox or nautilus or in the console. Firefox is a web browser and not a filebrowser.
Since Nautilus and Konqueror support the smb:// protocol, there isn't a reason to use Firefox to browse to samba shares in the first place.
Nautilus, the file manager included with GNOME, is the normal way to view SMB/CIFS shares in GNOME. It is not embeddable in Firefox, unlike the Windows file manager and IE. Firefox can, however, be persuaded to open a separate Nautilus window when you give it an smb:// URL, including from an HTML href anchor. This is what the protocol handlers mentioned in your first post are for.
To set up a protocol handler in Firefox, you need to change some settings in the configuration backend as they're not exposed in the normal UI. To open the configuration manager, type "about:config" into the address bar. Once the config manager loads, put "network.protocol-handler" into its "Filter" box to filter out all the properties irrelevant to protocol handlers. Change your settings to match those below. Forgive the manual table, LQ doesn't support HTML tables as far as I can tell.
Code:
Preference Name Type Value
network.protocol-handler.expose-all Boolean True
network.protocol-handler.expose.smb Boolean True
network.protocol-handler.external.smb Boolean True
network.protocol-handler.app.smb String /usr/bin/nautilus
As I don't have GNOME installed, I had to guess at the path to Nautilus. If it's wrong, Firefox will display an error saying "protocol smb isn't associated with any program" when you try to open an smb:// URL. If it does that, run "which nautilus" in a terminal and change the path to the one it prints.
As jschiwal and I both mentioned, it is also possible to mount SMB shares as a filesystem. Once it's mounted, it'll look just like any other directory. That way you can look at it with any program you like, whether or not it supports SMB. You seem to like the Firefox-launching-Nautilus solution, so I won't go into detail about mounting SMB shares. If you want me to, tell me.
using nautilus to view SMB shares is not a problem at all. that works just fine, and has been for some years. and SMB itself is operating just dandy without any problems at all.
the issue is only with being able to launch nautilus from a link within firefox (or any other browser, for that matter).
i tried your suggestion re changing the configuration of firefox via about:config. the only settings that were not already there were:
i set these, but still no deal. i re-checked the nautilus path using "which nautilus", and it was already correct.
btw, the reason i'm 'fixated' on using the web browser to launch nautilus is because my intranet is organised around client records. clicking on a "folder" link takes users straight to the client's folder, where all there relevant files are stored (often quite a few of them). i've still got a few Windows hold-outs in my office, and this is an issue for them. and i must say, i can see their point.
i'm starting to think that it's just not possible to do! which is a little depressing for me and my office ...
anyway, thanks for trying!
Last edited by kukukachu; 01-12-2010 at 05:27 AM.
Reason: fixation ...
This is exactly what Firefox's protocol handlers are for, so it should work. The documentation on protocol handlers is sparse at best so I think we're just missing something. I'll have access to my development box in a few hours, so I'll launch my Ubuntu VM and see if I can't get it working.
NOTE: What I'm writing here applies in my situation, to Firefox and Konqueror on Slackware, but it may well apply just as well for your situation.
This looks like the same situation as trying to get FF to launch Konqueror when it encounters a file:// link or when opening something from FF's sidebar..
By default, it doesn't work, for example in a case where I want to get at something I've downloaded, I want Konqueror to open up my downloads folder when I right-click the downloaded item in my FF downloads sidebar and select "Open Containing Folder". No go.
Putting the direct path to Konqueror, as you have done with Nautilus, does not work either for some reason, despite that appears the logical way to do things. Here's what I did (in about:config):
So, the file word above, you would want to change to smb.
Now, "/usr/bin/kfmclientexecscript4FF" is a script I made, which contains this:
Code:
#!/bin/sh
/usr/bin/kfmclient exec $1
exit 0
/usr/bin/kfmclient is the KDE Konqueror launcher tool. Firefox calls this script, handing the file:// URL to kfmclient, which results in Konqueror opening the file:// link.
I realize you're using Gnome and Nautilus, and I don't know if the mechanism for doing this in that environment is similar or radically different. Maybe your script would work with:
Code:
#!/bin/sh
/usr/bin/nautilus exec $1
exit 0
..or something sort of like this, but you'd need to play around with it to see what works, if anything.
Good luck; hope this helps and/or gives you ideas.
I think it's the right track too; it's unfortunate though that doing this sort of stuff seems to be implemented slightly differently from one version of FF to the next.. Keeps us on our toes I suppose :/
Now, I realize you've been all over the net searching (I found your problem posted elsewhere by you) but here's another link, just in case you haven't been to this one yet; it's a Mozilla KB article, describing what we're trying to do here: http://kb.mozillazine.org/Register_protocol#Linux
That's the "Linux" section of the page. You'll see 3 methods there: (1) for all FF versions and requires gnome libs; (2) FF3.5 specific..; and (3) FF up to 3.0 (not for us, too old.)
Now, method (2) shows setting network.protocol-handler.expose.foo to false, so that when FF encounters such a link (smb in your case) it should ASK you what app you want to open it with.
And method (1) shows some different way of, I guess, accomplishing the same thing, but it is Gnome-specific:
I think it's the right track too; it's unfortunate though that doing this sort of stuff seems to be implemented slightly differently from one version of FF to the next.. Keeps us on our toes I suppose :/
Now, I realize you've been all over the net searching (I found your problem posted elsewhere by you) but here's another link, just in case you haven't been to this one yet; it's a Mozilla KB article, describing what we're trying to do here: http://kb.mozillazine.org/Register_protocol#Linux
That's the "Linux" section of the page. You'll see 3 methods there: (1) for all FF versions and requires gnome libs; (2) FF3.5 specific..; and (3) FF up to 3.0 (not for us, too old.)
Now, method (2) shows setting network.protocol-handler.expose.foo to false, so that when FF encounters such a link (smb in your case) it should ASK you what app you want to open it with.
And method (1) shows some different way of, I guess, accomplishing the same thing, but it is Gnome-specific:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.