Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Portable Firefox and Locally stored homepage question  (Read 6172 times)

0 Members and 1 Guest are viewing this topic.

zeroburn

    Topic Starter


    Hopeful

  • Knowlege will take you further than any guide
  • Thanked: 2
    • Yes
    • Jared Kat Enterprises
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Portable Firefox and Locally stored homepage question
« 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.
I consider myself a hacker. Not in the way of "I can break into your facebook" but in the way, I like to learn as much as I can, about anything i can. I don't just like having things fixed, I like to understand why it was broken and why a particular solution fixed it. It is just how I am, and how I will always be. As teachers have said before, you cant learn if you don't figure it out in your own mind.

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: Portable Firefox and Locally stored homepage question
« Reply #1 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? 

zeroburn

    Topic Starter


    Hopeful

  • Knowlege will take you further than any guide
  • Thanked: 2
    • Yes
    • Jared Kat Enterprises
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Portable Firefox and Locally stored homepage question
« Reply #2 on: March 20, 2012, 02:13:43 PM »
The file name/directory that firefox finds the file at, is what i mean
I consider myself a hacker. Not in the way of "I can break into your facebook" but in the way, I like to learn as much as I can, about anything i can. I don't just like having things fixed, I like to understand why it was broken and why a particular solution fixed it. It is just how I am, and how I will always be. As teachers have said before, you cant learn if you don't figure it out in your own mind.

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: Portable Firefox and Locally stored homepage question
« Reply #3 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:\

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: Portable Firefox and Locally stored homepage question
« Reply #4 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.

Salmon Trout



    Genius

    Thanked: 968
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Other
Re: Portable Firefox and Locally stored homepage question
« Reply #5 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"

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: Portable Firefox and Locally stored homepage question
« Reply #6 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.  However, if he wants to open the HTML file from the flash drive on other computers, your solution seems the best.

zeroburn

    Topic Starter


    Hopeful

  • Knowlege will take you further than any guide
  • Thanked: 2
    • Yes
    • Jared Kat Enterprises
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Portable Firefox and Locally stored homepage question
« Reply #7 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.
I consider myself a hacker. Not in the way of "I can break into your facebook" but in the way, I like to learn as much as I can, about anything i can. I don't just like having things fixed, I like to understand why it was broken and why a particular solution fixed it. It is just how I am, and how I will always be. As teachers have said before, you cant learn if you don't figure it out in your own mind.

Kip



    Apprentice

    Thanked: 21
    • Yes
    • Yes
    • Yes
  • Experience: Experienced
  • OS: Windows 10
Re: Portable Firefox and Locally stored homepage question
« Reply #8 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:
  • Go to the "FirefoxPortable\Other\Source" folder.
  • Copy "FirefoxPortable.ini" to the main "FirefoxPortable" folder.
  • In the "FirefoxPortable.ini" file, set the "LocalHomepage" option to the relative path of the html file.

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.
Happiness is not getting what you want, it is wanting what you get.