LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Firefox smb woes ... any ideas? (http://www.linuxquestions.org/questions/linux-general-1/firefox-smb-woes-any-ideas-781219/)

kukukachu 01-10-2010 08:13 AM

Firefox smb woes ... any ideas?
 
i am wanting to use Firefox to connect to my smb shares. However, i keep getting this error message:
Firefox doesn't know how to open this address, because the protocol (smb) isn't associated with any program.
My client configuration is as follows:

Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.8pre) Gecko/20100106 Ubuntu/9.10 (karmic) Shiretoko/3.5.8pre
I tried the instructions below to try and fix the problem with no success:

Quote:

From http://www.cabo.dk/support-en/tips-a...et_language=en

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.

Regards.

Elemecca 01-10-2010 11:35 AM

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.

kukukachu 01-10-2010 10:00 PM

Quote:

Originally Posted by Elemecca (Post 3821257)
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!

jschiwal 01-10-2010 10:30 PM

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.

Elemecca 01-11-2010 07:29 AM

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.

kukukachu 01-12-2010 06:20 AM

thanks for your reply.

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:

network.protocol-handler.expose-all Boolean True
network.protocol-handler.expose.smb Boolean True

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!

Elemecca 01-12-2010 09:13 PM

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.

GrapefruiTgirl 01-12-2010 10:05 PM

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):

Code:

Name:                                Value:
network.protocol-handler.expose-all      true (bool)
network.protocol-handler.app.file        /usr/bin/kfmclientexecscript4FF (string)
network.protocol-handler.external.file  true (bool)

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.

Sasha

kukukachu 01-13-2010 07:04 PM

thanks GrapefruiTgirl.

i tried all you suggested, adjusted of course for smb and GNOME, but still no dice. keeps coming up with the exact same error message.

but this does seem to be the right track. clearly i must be doing something else fundamentally wrong.

i shall keep tinkering and get back if i find the solution!

GrapefruiTgirl 01-13-2010 07:38 PM

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:
Code:

gconftool-2 -s /desktop/gnome/url-handlers/smb/command '/path/to/app %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/smb/enabled --type Boolean true

I'm not sure, the page doesn't say, but maybe you need to do BOTH (1) and (2) on that section, for this to work?

Keep us posted!

Sasha

kukukachu 01-15-2010 08:08 AM

Quote:

Originally Posted by GrapefruiTgirl (Post 3825715)
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:
Code:

gconftool-2 -s /desktop/gnome/url-handlers/smb/command '/path/to/app %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/smb/enabled --type Boolean true

I'm not sure, the page doesn't say, but maybe you need to do BOTH (1) and (2) on that section, for this to work?

Keep us posted!

Sasha

OK! got it! after 12 months struggling with this, i've finally got it! :)

this solution is specific to firefox 3.5 and higher under GNOME.

1. Step 1: Firefox about:config
Code:

network.protocol-handler.expose.smb;false
network.protocol-handler.external.smb;true

2. at the command line:
Code:

gconftool-2 -s /desktop/gnome/url-handlers/smb/command '/usr/bin/nautilus %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/smb/enabled --type Boolean true

3. run firefox and enter your smb URL into the address bar, eg:
Code:

smb://myserver/myfolder
a menu will pop up asking you which application to use. select nautilus, click the "always use" checkbox, and bob's your uncle!


to all those who said it couldn't be done: :p

to sasha and everyone else in this thread who believed it was possible: thank you!

GrapefruiTgirl 01-15-2010 11:38 AM

Excellent -- I like a happy ending ;)

Happy smb'ing!

Sasha


All times are GMT -5. The time now is 04:38 PM.