[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

firefox més util



He pensat que igual a algu de vosaltres us pot ser d'utilitat un script que em vaig treballar per poder usar el firefox (o mozilla) "integrat" des de consola, gnome, kde i per que obris finestra nova automaticament quan detectes un firefox ja funcionant. Tambe soluciona el tema dels espais en blanc... (no se si algu s'hi ha barallat mai...)

a mi em resulta d'extrema utilitat, no sé si ja existia previament alguna solucio similar o no... suposant que no n'existis algu sap com fer-ho arribar als desenvolupadors de mozilla per que ho incloguin en la distri oficial del programa? he mirat per la web pero no he acabat de trobar el lloc idoni... pels newsgroups?

per mi aquesta funcionalitat i el fet de que els plugins mes habituals (java i flash) no vinguin preinstalats, son per mi els punts mes debils del magnific firefox. Algu sap el motiu pel qual no s'inclouen aquests plugins preinstalats?

vinga, avui m'ha vingut la vena colaboradora. fns aviat
#!/bin/bash
# script for firefox use at KDE's, GNOME'S, graphical console...
# tiny hack by MarC.  suggestions at mvinyes@ole.com

#the following options are applied when mozilla is already running...
NEW="new-window"
#to open the requested content in a new window (default)
#NEW="new-tab"
#to open the requested content in a new tab (uncomment to make it active)

#you must set the path of mozilla/firefox in your system
MOZILLA_PATH="/usr/local/bin/firefox/firefox"

if [ "$1" != "" ]
then
 if [ "`expr substr "$1" 1 7`" = "http://"; ] || [ "`expr substr "$1" 1 6`" = "about:" ]
 then
  FILE_PATH="$1"
 else
  if [ "`expr substr "$1" 1 3`" = "www" ]
  then
   FILE_PATH="http://$1";
  else
   if [ "`expr substr "$1" 1 1`" = "/" ]
   then
    FILE_PATH="file://$1"
   else
    if [ -f "$1" ]
    then
     FILE_PATH="file://`pwd`/$1"
    else
     FILE_PATH="http://$1";
    fi
   fi
  fi
 fi
else
 FILE_PATH=""
fi

#to fix space characters problem
FILE_PATH=${FILE_PATH//" "/"%20"}

#if mozilla is already running then open a new window or a new tab
if ps ax | grep $MOZILLA_PATH | grep -v "grep"; then
$MOZILLA_PATH -remote "openURL($FILE_PATH, $NEW)"&
else
$MOZILLA_PATH $FILE_PATH&
fi

Reply to: