Computer Hope

Software => Internet browsers => Topic started by: zeroburn on March 20, 2012, 10:42:36 AM

Title: Portable Firefox and Locally stored homepage question
Post by: zeroburn on March 20, 2012, 10:42:36 AM
Hello to all. I have the Portable firefox from PortableApps.com installed on an 8 gig flash disk.
I also have designed a custom homepage (all in one file, embedded CSS, images in online locations) on the same disk.

My question. How do i get the link to automatically detect the drive that the firefox is on and subsequently, the file i want

so i would like something like this
file:///%drive%/PortableApps/FirefoxPortable/homepage.html

where %drive% would be the apropriate code for detecting the flash drive letter.
Title: Re: Portable Firefox and Locally stored homepage question
Post by: soybean on March 20, 2012, 02:10:28 PM
Quote
My question. How do i get the link to automatically detect the drive that the firefox is on and subsequently, the file i want
What link are you talking about? 
Title: Re: Portable Firefox and Locally stored homepage question
Post by: zeroburn on March 20, 2012, 02:13:43 PM
The file name/directory that firefox finds the file at, is what i mean
Title: Re: Portable Firefox and Locally stored homepage question
Post by: soybean on March 20, 2012, 02:33:31 PM
Maybe I'm still missing the point but, as I see it, you simply need to replace %drive% with the actual drive letter.  For example: C:\
Title: Re: Portable Firefox and Locally stored homepage question
Post by: soybean on March 20, 2012, 02:42:17 PM
Oops, sorry, my example should be C:/.  In other words, use a forward slash after the colon.  However, you already have a colon after %drive%, so just replace %drive% with C: or the applicable drive letter.
Title: Re: Portable Firefox and Locally stored homepage question
Post by: Salmon Trout on March 20, 2012, 03:25:01 PM
Maybe I'm still missing the point but, as I see it, you simply need to replace %drive% with the actual drive letter.  For example: C:\

The point is that a USB flash drive is a removable drive and therefore does not have a predictable drive letter.

I think the OP wishes to have the portable Firefox use a homepage stored on the same flash disk.

To do this we need to detect the drive letter of the flash disk and append a line to the Firefox preferences file.

This script should be placed in the same folder as PortableFirefox.exe. Save it with a .bat extension. Double click it to start Firefox with the desired homepage already set.

Code: [Select]
@echo user_pref("browser.startup.homepage", "file:///%~d0/PortableApps/FirefoxPortable/homepage.html"); >> Data\profile\prefs.js & start "" "FirefoxPortable.exe"
Title: Re: Portable Firefox and Locally stored homepage question
Post by: soybean on March 20, 2012, 04:47:43 PM
The point is that a USB flash drive is a removable drive and therefore does not have a predictable drive letter.

I think the OP wishes to have the portable Firefox use a homepage stored on the same flash disk.
I was thinking that too but was seeking confirmation/clarification from the OP. 

I believe an alternative approach would be to assign a permanent drive letter to the flash drive (http://windows.microsoft.com/en-US/windows-vista/Change-add-or-remove-a-drive-letter).  However, if he wants to open the HTML file from the flash drive on other computers, your solution seems the best.
Title: Re: Portable Firefox and Locally stored homepage question
Post by: zeroburn on March 21, 2012, 09:53:41 AM
Thanks for the help so far, and i am still looking into some other options. But so far i do appreciate the help, and i am looking into the batch file option, However, i would like to have the App Icon in the portable apps launcher menu go to the batch instead of the EXE file.
Thank you.
Title: Re: Portable Firefox and Locally stored homepage question
Post by: Kip on March 21, 2012, 10:58:45 PM
There is a configuration file included in the FirefoxPortable folder that contains an option that should do what you want.  Here is how to set it up:

For example, if the FirefoxPortable folder is at "E:\FirefoxPortable" and the html file is at "E:\homepage.html", set the option to "..\homepage.html".  Or, if the html file is in the FirefoxPortable folder, set the option to "homepage.html".  Because it accepts relative paths, you do not need to worry about the drive letter.