LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
LinkBack Search this Thread
Old 01-10-2010, 07:13 AM   #1
kukukachu
LQ Newbie
 
Registered: Jan 2010
Location: Jakarta, Indonesia
Distribution: ubuntu 11.10 64bit
Posts: 11

Rep: Reputation: 2
Exclamation 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.
 
Old 01-10-2010, 10:35 AM   #2
Elemecca
Member
 
Registered: Nov 2008
Location: San Francisco, CA
Distribution: Gentoo, CentOS
Posts: 71

Rep: Reputation: 22
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.
 
Old 01-10-2010, 09:00 PM   #3
kukukachu
LQ Newbie
 
Registered: Jan 2010
Location: Jakarta, Indonesia
Distribution: ubuntu 11.10 64bit
Posts: 11

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Elemecca View Post
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!
 
Old 01-10-2010, 09:30 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 01-11-2010, 06:29 AM   #5
Elemecca
Member
 
Registered: Nov 2008
Location: San Francisco, CA
Distribution: Gentoo, CentOS
Posts: 71

Rep: Reputation: 22
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.
 
1 members found this post helpful.
Old 01-12-2010, 05:20 AM   #6
kukukachu
LQ Newbie
 
Registered: Jan 2010
Location: Jakarta, Indonesia
Distribution: ubuntu 11.10 64bit
Posts: 11

Original Poster
Rep: Reputation: 2
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!

Last edited by kukukachu; 01-12-2010 at 05:27 AM. Reason: fixation ...
 
Old 01-12-2010, 08:13 PM   #7
Elemecca
Member
 
Registered: Nov 2008
Location: San Francisco, CA
Distribution: Gentoo, CentOS
Posts: 71

Rep: Reputation: 22
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.
 
Old 01-12-2010, 09:05 PM   #8
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
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
 
Old 01-13-2010, 06:04 PM   #9
kukukachu
LQ Newbie
 
Registered: Jan 2010
Location: Jakarta, Indonesia
Distribution: ubuntu 11.10 64bit
Posts: 11

Original Poster
Rep: Reputation: 2
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!
 
Old 01-13-2010, 06:38 PM   #10
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
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
 
1 members found this post helpful.
Old 01-15-2010, 07:08 AM   #11
kukukachu
LQ Newbie
 
Registered: Jan 2010
Location: Jakarta, Indonesia
Distribution: ubuntu 11.10 64bit
Posts: 11

Original Poster
Rep: Reputation: 2
Cool

Quote:
Originally Posted by GrapefruiTgirl View Post
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:

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

Last edited by kukukachu; 02-25-2011 at 01:31 AM. Reason: code error
 
Old 01-15-2010, 10:38 AM   #12
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Excellent -- I like a happy ending

Happy smb'ing!

Sasha
 
  


Reply

Tags
firefox3, gnome, smb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bluetooth woes, any ideas? plisken Linux - Networking 1 03-07-2006 12:18 PM
Any ideas when a 64bit java plugin for firefox? carl0ski Linux - Software 1 11-29-2005 03:09 PM
Firefox - HTTPS works, but HTTP doesn't, any ideas? (Newbie question) RichardDarling Linux - Networking 2 11-03-2005 08:23 AM
using smb in firefox PeaceTank Linux - Software 1 12-30-2004 03:29 PM
Firefox woes calimer Linux - Software 9 10-17-2004 04:25 PM


All times are GMT -5. The time now is 10:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration