Bug 115777 - Launch Firefox as external navigator failed if Firefox is not already opened
Summary: Launch Firefox as external navigator failed if Firefox is not already opened
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-06 12:27 UTC by effco
Modified: 2006-11-30 10:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description effco 2005-11-06 12:27:17 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    SuSE RPMs

Hi,

this is my Akregator config :
left mouse button : External navigator
middle mouse button : External navigator

For external navigation :
   use this command : firefox -remote 'openURL(%u,new-tab)'

The problem is that if Firefox isn't already running, opening a new tab in Firefox fails. Nothing happens, the browser just does not start up.

What I suggest to solve this is to change the command 
firefox -remote 'openURL(%u,new-tab)'
to something like
/usr/local/bin/firefox.sh %u

where the firefox.sh script contains the following :

<code>
#!/bin/sh
url="$1"
if [ "x$url" = "x" ]; then
        url="about:blank"
fi

if firefox -remote openURL\("$url"\,new-tab\); then
        exit 0
fi
exec firefox "$url"
</code>

Another solution would be to change the command
firefox -remote 'openURL(%u,new-tab)'
to
firefox -remote 'openURL(%u,new-tab)' || firefox %u

so that if the command
firefox -remote 'openURL(%u,new-tab)'
fails, the command 
firefox %u
start Firefox by opening a brand new window

The later solution is the easiest to implement but, while the first solution is perfectly running, I've tried the second one and unfortunately it doesn't work.

Maybe a problem of command parsing in the "use this command" field ?
Comment 1 Eckhart Wörner 2005-11-15 22:38:57 UTC
Why don't we just change default command to firefox "%u"? IMHO this is the best idea as firefox then may decide whether it should open the page in a new tab, or in a new page, so we would not override firefox settings.
Comment 2 effco 2005-11-15 23:02:50 UTC
Indeed you're right, your solution is far easier.

I've tried with Firefox 1.0.7 and it works perfectly. It respect the behavior selected in Firefox->Edit->Preferences->Advanced->Tab Navigation.

Let's go for "firefox %u" then
Comment 3 Frank Osterfeld 2005-11-19 11:38:19 UTC
SVN commit 481506 by osterfeld:

use "firefox %u" as default for external browser
BUG: 115777


 M  +1 -1      settings_browser.ui  


--- branches/KDE/3.5/kdepim/akregator/src/settings_browser.ui #481505:481506
@@ -64,7 +64,7 @@
                         <bool>false</bool>
                     </property>
                     <property name="text">
-                        <string>firefox -remote 'openURL(%u,new-tab)'</string>
+                        <string>firefox %u</string>
                     </property>
                 </widget>
             </grid>
Comment 4 Frank Osterfeld 2005-11-19 11:39:26 UTC
SVN commit 481508 by osterfeld:

forward port of 115777 (firefox command)
CCBUG: 115777


 M  +1 -1      settings_browser.ui  


--- trunk/KDE/kdepim/akregator/src/settings_browser.ui #481507:481508
@@ -157,7 +157,7 @@
          <bool>false</bool>
         </property>
         <property name="text" >
-         <string>firefox -remote 'openURL(%u,new-tab)'</string>
+         <string>firefox %u</string>
         </property>
        </widget>
       </item>
Comment 5 Pau Capdevila 2006-02-03 17:25:47 UTC
Still not working in kde 3.5.1 under Debian
Comment 6 Frank Osterfeld 2006-02-04 15:44:50 UTC
Which command do you use? Try "firefox %u". It's the new default, but if
you have old settings (which you probably have), the old command is still set.
Comment 7 Pau Capdevila 2006-02-04 15:58:08 UTC
Ok, "firefox %u" works well.

Thank you very much.
Comment 8 Gehold Bertin 2006-11-30 00:11:18 UTC
I've same problem: Using default entry: firefox -remote 'openURL(%u,new-tab)'

My installation of Kubuntu is only two weeks old...

But "firefox %u" works well. 
Comment 9 Frank Osterfeld 2006-11-30 10:53:28 UTC
SVN commit 609335 by osterfeld:

backport from trunk: use "firefox %u" as default for the custom browser setting
CCBUG:115777


 M  +1 -1      ChangeLog  
 M  +1 -1      src/akregator.kcfg  


--- branches/KDE/3.5/kdepim/akregator/ChangeLog #609334:609335
@@ -6,7 +6,7 @@
 -----------------------------
 
 Bug fixes:
-
+ 2006/11/30 Use "firefox %u" as default for the alternative browser command (#115777)
  2006/11/24 Add session management for browser tabs (#100964) Patch by Carsten Pfeiffer <pfeiffer at kde.org> -fo
  2006/11/10 Fix crash in Konqueror icon plugin sometimes happening when switching parts (#134929) -fo
  2006/10/31 Fix group name encoding bug when adding feeds from commandline (e.g., using the Konq plugin) (#136559)
--- branches/KDE/3.5/kdepim/akregator/src/akregator.kcfg #609334:609335
@@ -154,7 +154,7 @@
   </entry>
   <entry key="External Browser Custom Command" type="String" >
    <whatsthis>Command to launch external browser.  URL will substitute for %u.</whatsthis>
-   <default>firefox -remote 'openURL(%u,new-tab)'</default>
+   <default>firefox %u</default>
   </entry>
   <entry key="LMB Behaviour" type="Enum" >
    <whatsthis>What the click with left mouse button should do.</whatsthis>