X
Tap here to go to the mobile version of the site.

Fóram Tacaíochta

Cuireadh an snáithe seo sa chartlann. Cuir ceist nua má tá cabhair uait.

How do I resize the Firefox window to a specific pixel width (from within Firefox)?

Postáilte

I need to take screen captures at a specific width. How can I set the window width, say, to 1275 pixels? Height is not important. I'd like to be able to do this from within the Firefox window itself.

I need to take screen captures at a specific width. How can I set the window width, say, to 1275 pixels? Height is not important. I'd like to be able to do this from within the Firefox window itself.

Réiteach roghnaithe

  1. Open Scratchpad either by pressing Shift+F4 or clicking the Firefox button, opening the Web Developer submenu, then choosing Scratchpad.
  2. In the Scratchpad window, type window.resizeTo(1275,700);
  3. Press Ctrl+R or open the Execute menu and choose Run.
Read this answer in context 0

Tuilleadh mionsonraí faoin chóras

Feidhmchlár

  • User Agent: Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20100101 Firefox/13.0.1

Tuilleadh Eolais

Gingerbread Man 403 réiteach 1537 freagra

Réiteach Roghnaithe

  1. Open Scratchpad either by pressing Shift+F4 or clicking the Firefox button, opening the Web Developer submenu, then choosing Scratchpad.
  2. In the Scratchpad window, type window.resizeTo(1275,700);
  3. Press Ctrl+R or open the Execute menu and choose Run.
# Open Scratchpad either by pressing '''Shift+F4''' or clicking the Firefox button, opening the Web Developer submenu, then choosing Scratchpad. # In the Scratchpad window, type ''window.resizeTo(1275,700);'' # Press '''Ctrl+R''' or open the Execute menu and choose Run.
cor-el
  • Top 10 Contributor
  • Moderator
17468 réiteach 157870 freagra

Freagra Cabhrach

This will only work if there is an XUL (chrome) window like the about:newtab page is open and selected. Such pages have elevated permissions and allow scripts to change the window dimensions.

This will only work if there is an XUL (chrome) window like the about:newtab page is open and selected. Such pages have elevated permissions and allow scripts to change the window dimensions.

Úinéir na ceiste

Hi Gingerbread_Man, thanks for your response. I tried that and it didn't work. No effect. I have JavaScript enabled (in Tools, Options), and Allow scripts to resize popup windows is enabled. Combining your reply with cor-el's, I'm able to do it. Thanks!

Hi Gingerbread_Man, thanks for your response. I tried that and it didn't work. No effect. I have JavaScript enabled (in Tools, Options), and Allow scripts to resize popup windows is enabled. Combining your reply with cor-el's, I'm able to do it. Thanks!

Athraithe ag shuttie27 ar

Úinéir na ceiste

Hi cor-el. Although I don't know what you mean by a XUL window, I tried the script on a new tab and it worked. So I guess it is a matter of permissions. I guess I could open a new tab, run the script, then switch back to the original tab. Thanks!

Hi cor-el. Although I don't know what you mean by a XUL window, I tried the script on a new tab and it worked. So I guess it is a matter of permissions. I guess I could open a new tab, run the script, then switch back to the original tab. Thanks!
cor-el
  • Top 10 Contributor
  • Moderator
17468 réiteach 157870 freagra

It also works with the "Tools > Add-ons" page (about:addons), so that is an alternative if the new tab page is set to about:blank (like I prefer).

It doesn't matter if Tools > Options > Content : JavaScript > Advanced > Allow Scripts to: "Move or resize existing windows" is disabled.

It also works with the "Tools > Add-ons" page (about:addons), so that is an alternative if the new tab page is set to about:blank (like I prefer). It doesn't matter if Tools > Options > Content : JavaScript > Advanced > Allow Scripts to: "Move or resize existing windows" is disabled.
Gingerbread Man 403 réiteach 1537 freagra

Alternatively, you can install an extension. For example, “Web Developer” allows you to resize the window from its toolbar. It works regardless of which page is open, and it's simpler than typing Javascript code in a separate window.

Alternatively, you can install an extension. For example, “Web Developer” allows you to resize the window from its toolbar. It works regardless of which page is open, and it's simpler than typing Javascript code in a separate window. * https://addons.mozilla.org/firefox/addon/web-developer/