You are here

How to specify relative path in 'browser.newtab.url'?

20 posts / 0 new
Last post
Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
How to specify relative path in 'browser.newtab.url'?

Hi.

I'd like to use a path to a local .html file for 'browser.newtab.url' about:config pref.
The .html-file that path points to - is in the FirefoxPortable folder, just next to firefoxpotable.exe.

How to assign a value so, that the path would be relative to firefoxportable folder?

If I assign a static path - it will stop working as soon as I move FirefoxPortable folder to a different place.

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Try It

Our launcher automatically adjusts paths for you. So as long as you move them together relative to the drive root or within the FirefoxPortable directory, they continue to work.

Sometimes, the impossible can become possible, if you're awesome!

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
so what path should I specify

so what path should I specify to make 'browser.newtab.url' pref always point to the 'homepage.html' file that lies next to firefoxportable.exe?

Currently I use static path, thus the value looks like this:
file:///C:/Firefox%20Release/homepage.html

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
Is there a variable which

Is there a variable which contains path to firefoxportable.exe that I could use in about:config pref?

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Automatic

As I said, it should be automatic. You just set it to the full path and the launcher will adjust it. There are no variables.

Sometimes, the impossible can become possible, if you're awesome!

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
Doesn't work for me for the

Doesn't work for me for the specified pref 'browser.newtab.url' but works fine for 'browser.startup.homepage'

STR:
1. set both prefs to point at file:///C:/Firefox Release/homepage.html
2. move 'C:/Firefox Release/' folder to 'R:/temp/Firefox Release'
3. run firefoxportable.exe from the new location and go to about:config for the prefs' values:
browser.newtab.url;file:///R:/Firefox Release/homepage.html
browser.startup.homepage;file:///R:\Temp\Firefox Release/homepage.html

the first pref contains wrong path.

MiK
Offline
Last seen: 9 months 1 week ago
Joined: 2008-08-14 18:25
After running several tests,

After running several tests, I can confirm that this worked for me the same way as for you.

Only the drive letter was updated, so as long as the path for the folder containing the Firefox Portable was kept the same, without changing by adding sub-directories like in your example, everything worked fine.

And the reason it worked for your homepage is, by appearance, the use of the FirefoxPortable.ini with the LocalHomepage specification.

In case you would really like to work with different paths when moving your Firefox Portable folder, not everything is lost, there is a way of achieving what you wish for, however requiring several more steps, but also with some added benefits.

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
Ping. Any news? There seems

Ping.

Any news?

There seems to be a bug and it has been confirmed by another board member.

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Yet Supported

Since it's a non-standard feature to change (it's not in Options, only buried in about:config), it's not something we built support to portablize out of the box. So, it'd have to be added as a new ability of the launcher.

If I can ask, what are you trying to set your new tab as? I don't think I've never come across anyone changing it before, other than trying to unchange it from something that messed with it (spyware/malware/adware).

Sometimes, the impossible can become possible, if you're awesome!

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
> If I can ask, what are you

> If I can ask, what are you trying to set your new tab as?

I want every new tab open my homepage.
Earlier I used a special extension for that(and there are actually quite a lot of similar ones, by the way, this fact may also serve as an indirect proof of some demand for that feature), but since some version Firefox got this functionality built-in.

So yeah, I prefer to use an about:config pref now in order to shorten my list of extensions by 1.

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Just Realized

I just realized you're moving the full relative path, which isn't currently supported for either one. If you just have the drive letter change, the setting of the new tab will work fine as long as you have the path in the form file:///C:...etc. Again, neither the new tab nor the homepage support a relative path to a full file, just drive letter changes. So, if you move it from C:/Firefox Release/ to T:/Firefox Release/, it'll work. But if you move it from C:/Firefox Release/ to T:/temp/Firefox Release/, it'll fail.

Sometimes, the impossible can become possible, if you're awesome!

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
No. See

No.
See https://portableapps.com/node/41370#comment-215348

browser.startup.homepage handles new path correctly, even if not only the drive letter was changed.

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Drive

Either way, new tab works portably as you move your drive between PCs. Or is that not what you're doing?

Sometimes, the impossible can become possible, if you're awesome!

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
Yes, it's not what I am

Yes, it's not what I am doing.

I'm sometimes testing stuff and sometimes there's a need to just copy the whole FirefoxPortable folder to another place to make 2 copies run simultaneously (for comparison and other stuff).

Also, I'm using portable software on my desktop instead of installs, because in my opinion Windows sux hard at managing installed programs, there are too many hidden places where "normal" programs store their data. I hate this, so I prefer to use portable software everywhere I can.

I have more portable software and utils (not requiring installs) than installed software (there are still some programs that can't be easily replaced with a portable copy).

And no, I don't move my drive between PCs, because mainly I work on a single PC.
But please don't give up on users like me, I think there are pretty lot of such users.

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
John, could you, please, make

John, could you, please, make browser.newtab.url work just as good as browser.startup.homepage does?

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Possible Fix

I've uploaded an updated launcher you can try out by downloading from here: FirefoxPortable.exe (source code). BACKUP your copy of Firefox Portable before trying this, though, and then replace your existing launcher with this one. This should adjust all file: style paths within Firefox but only relative to FirefoxPortable.exe. So, everything within the FirefoxPortable directory will be adjusted, but things one level up will not. Let me know how this works for you.

Sometimes, the impossible can become possible, if you're awesome!

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
Unfortunately, it doesn't

Unfortunately, it doesn't work for me:
I move "c:\firefox\" to "c:\s\v\firefox\" and get this
browser.newtab.url;file:///C:\Firefox/homepage.html
browser.startup.homepage;file:///C:\s\v\Firefox/homepage.html

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Wrong Format

File URLs are supposed to use forward slashes. Open an HTML file by dragging it into Firefox and it'll only use forward slashes. You have a blackslash after C: which is breaking it. Forward slashes only and it'll work.

Sometimes, the impossible can become possible, if you're awesome!

Drugoy
Offline
Last seen: 8 years 3 months ago
Joined: 2011-04-02 16:59
There's something weird: I've

There's something weird: I've changed the back slash in browser.newtab.url to forward slash and then running Firefox after moving it's folder - worked fine.

Yet, in about:config I see that browser.startup.homepage still uses back slash after the disk in the path: file:///C:\Firefox/homepage.html
although I've changed back slash to forward slashes in both prefs.
So it's portableapps util that changed forward slash back to back slash.
Yet, it works anyways: both opening new tab and hitting "home" button - open homepage url (but the address always consists of only forward slashes).

John T. Haller
John T. Haller's picture
Offline
Last seen: 5 hours 12 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Bug

There's a bug in the startup homepage code that does it that way. I built an old custom routine to manually handle the homepage specifically on request from a user. It's from I think 6 years ago, so it was before we properly adjusted relative paths.

The proper way to do the path is forward slashes only, though it will work with back slashes. Unfortunately, forward and back slashes are different when replacing paths and will break the path adjustments on newtab.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments