开发者

Adjust the size of the browser window when starting Firefox

开发者 https://www.devze.com 2023-04-03 19:21 出处:网络
Is it possible to predefine what size a Fir开发者_如何学编程efox browser window should have when starting? I would like to set it example 400px x 600px.

Is it possible to predefine what size a Fir开发者_如何学编程efox browser window should have when starting? I would like to set it example 400px x 600px. If yes, I assume it should be stored under a Firefox profile somehow?

Anyone having an idea?


http://kb.mozillazine.org/Command_line_arguments

Create a shortcut and append parameters at the end: firefox.exe -width 400 -height 600


As far as I can tell, there is no configuration setting for this with Firefox Quantum 64. Nor is there a way to call firefox with width/height or geometry parameters.

However, the width & height are stored in a human-readable file, xulstore.json, in your profile. So you can run a little program to change the size in that file before firefox opens.

For example, if you have a Linux system, a simple sed program with these 2 lines will set the size to 1000x1050 pixels:

 s/\(width[^0-9]*\)\([0-9][0-9]*\)/\11000/

 s/\(height[^0-9]*\)\([0-9][0-9]*\)/\11050/

I don't know anything about Windows or Mac scripting.


An update to jacub.g answer.

Besides defining width and height you also need to provide a profile name

firefox -width 400 -height 600 -P default

You can also put some random name for the profile. Firefox will open a dialog window to create new profile if it does not find such.

firefox -width 400 -height 600 -P my_new_profile_name
0

精彩评论

暂无评论...
验证码 换一张
取 消