4

I need to startup either Chrome or Firefox in a set location, with a set size and without the tabs and other menu items. The ultimate goal is a desktop icon I can click to get a window X wide by Y tall at x,y on my desktop showing a particular page, without making these settings permanent for the browser.

This is going to be a small window placed in the corner of a desktop showing an AJAX page that is updating throughout the day.

I can't seem to find any option for either of these browsers.

Makyen
  • 31,849
  • 12
  • 86
  • 121
vSteve
  • 63
  • 1
  • 1
  • 8
  • 1
    Possible duplicate of [How to hide address bar from chrome and mozilla](https://stackoverflow.com/questions/18715687/how-to-hide-address-bar-from-chrome-and-mozilla) – Evan Carroll Nov 24 '18 at 22:53
  • The below mentioned add-ons don't work anymore with newer FF versions. I added an alternative answer to the above mentioned duplicate. – Ida Nov 11 '21 at 14:59

1 Answers1

5

In Firefox:

You can find details of the Firefox "Command Line Options" on MDN.

It appears you can not do exactly what you desire, if you want to continue to have the page opened under your normal profile and without having your normal use of that profile disturbed. If you are willing to use a separate profile which is used only for this task, then you can accomplish what you desire. Using another profile is not a big deal. I commonly have more than one running at a time, and even use different versions of Firefox running at the same time under different profiles.

Using a separate profile and add-ons:

To create a new profile see: Use the Profile Manager to create and remove Firefox profiles or Multiple Firefox profiles. Create a profile, choose a name.

You will need some add-ons:

  • Hide Navigation Bar (change options (Tools->Add-ons then "Extensions" and the "options button for this extension. Select "When Firefox starts: Hide the Navigation Bar")
  • Hide Tabbar (change options to select "Auto hide when only one tab is open")

There may be others you could use, but the combination of these two worked when I tested it.

Go to the page you want to see. Adjust the size and position of the window to what you desire. By right clicking the mouse in the toolbar area de-select "Menu Bar" and "Bookmarks Toolbar". Close Firefox. Firefox should automatically remember the size and location of the window.

Create a shortcut:

  "C:\Program Files\Mozilla Firefox\firefox.exe" -no-remote -P "My Profile Name" -url "http://the page I want to see"

Click on the shortcut. That should work.

Shameless plug: If you want the icon for the window to be different so you can tell the windows apart in the taskbar, you could use: Change Profile's Window Icons. An extension whicht arose from my answer to a stackoverflow question. If you do change the icon, you will probably want to change the properties for the shortcut to point to the icon you use.

Getting close to what you want using your current profile without disturbing it:

Without using an add-on you can come close. [Note: all were tested in Firefox and a Windows operating system assumed (for file paths).]

You could use a bookmarklet to open a static URL in a limited window :

javascript:void(window.open("http://www.google.com","_blank","outerWidth=400,outerHeight=200,top=500,left=600,menubar=no,toolbar=no,location=no,personalbar=no,status=no,resizable"))

or the URL you are currently viewing:

javascript:void(window.open(location.href,"_blank","outerWidth=400,outerHeight=200,top=500,left=600,menubar=no,toolbar=no,location=no,personalbar=no,status=no,resizable"))

You can have the window open from a desktop shortcut, but in order to have the window with a limited interface you will end up with a normal size window which you will have to close (scripts are not permitted to close windows which are not opened by a script). You would need to use an html file on your machine to contain the script to open the appropriate URL.

Note the first time you do this Firefox will inform you that it blocked a popup. You will need to permit popups from that file URL.

Example HTML file (example assumes it is located at: C:\open_location.html):

<head>
    <script class="code" type="text/javascript">
        var features =  ""  
                        + "menubar=no,toolbar=no,location=no,personalbar=no"
                        + ",status=no,chrome=yes,resizable,centerscreen"
                        //+ ",width=400"        //Width of content window
                        //+ ",height=200"       //Height of content window
                        + ",outerWidth=400"   //Width of window
                        + ",outerHeight=200"  //Height of window
                        + ",top=500"
                        + ",left=600"
                        ;
        window.open("http://www.google.com/","_blank",features);
        //Can only close windows opened by script.
        //window.close();
    </script>
</head>
<body>
</body>

You could then use a shortcut that opens the URL of that file:

"C:\Program Files\Mozilla Firefox\firefox.exe" -url "file://C:/open_location.html"

I would suggest using a separate profile:

"C:\Program Files\Mozilla Firefox\firefox.exe" -no-remote -P "My Profile Name" -url "file://C:/open_location.html"

You can get rid of the URL bar from all of the above by setting dom.disable_window_open_feature.location=false in about:config. However, if you do that I recommend using a different profile which is used for this purpose only as you normally don't want to do such for normal use.

Community
  • 1
  • 1
Makyen
  • 31,849
  • 12
  • 86
  • 121
  • firefox open a new window in a new instance with new profile and load a local file `open_location.html`. The local file open the expectation site `https://www.google.com`. But how to close the local web file `open_location.html`? – Nick Dong May 28 '19 at 07:53