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

Support Forum

How can I get Javascript moveTo and resizeTo bookmarklets working again?

Posted

Years ago, a Lifehacker article gave me exactly what I needed: a quick and simple way to resize the various Firefox windows I need open at my office to make them precisely the size and position I need them. — http://lifehacker.com/292901/resize-firefox-with-a-bookmarklet

Unfortunately, upgrading to Firefox 7 seems to prevent these bookmarklets from working. What do I need to do to get them up and running again? It might sound unusual, but this is a critical issue for me. I've downgraded to 6.0.2 until I find a solution that works.

Years ago, a Lifehacker article gave me exactly what I needed: a quick and simple way to resize the various Firefox windows I need open at my office to make them precisely the size and position I need them. — http://lifehacker.com/292901/resize-firefox-with-a-bookmarklet Unfortunately, upgrading to Firefox 7 seems to prevent these bookmarklets from working. What do I need to do to get them up and running again? It might sound unusual, but this is a critical issue for me. I've downgraded to 6.0.2 until I find a solution that works.

Modified by mgrad92

Additional System Details

Installed Plug-ins

NoScript (I think this is the only plugin I've got that's relevant to this issue)

Application

  • User Agent:

More Information

Application Basics
Name
Firefox
Version
6.0.2
User Agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Profile Directory
Show in Finder
Enabled Plugins
about:plugins
Build Configuration
about:buildconfig
Extensions
Name
Version
Enabled
ID
1Password
3.8.6.b3
true
onepassword@agilebits.com
Adblock Plus
1.3.9
true
{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}
Bloody Vikings!
0.5.3
true
bloodyvikings@ffs.bplaced.net
Empty Cache Button
1.9
true
{4cc4a13b-94a6-7568-370d-5f9de54a9c7f}
Evernote Web Clipper
5.0.0.177572
true
{E0B8C461-F8FB-49b4-8373-FE32E9252800}
Flash Video Downloader Youtube Downloader Facebook
2.0.33
true
artur.dubovoy@gmail.com
Flashblock
1.5.15.1
true
{3d7eb24f-2740-49df-8937-200b1cc08f8a}
Force-TLS
3.0.0
true
forcetls@sid.stamm
Form History Control
1.2.9.3
true
formhistory@yahoo.com
MeasureIt
0.4.10
true
{75CEEE46-9B64-46f8-94BF-54012DE155F0}
NoScript
2.1.3
true
{73a6fe31-595d-460b-a920-fcc0f8843232}
User Agent Switcher
0.7.3
true
{e968fc70-8f95-4ab9-9e79-304de2a71ee1}
Better Facebook!
5.931
false
betterfacebook@mattkruse.com
bit.ly preview
1.272
false
bitlypreview@jay.ridgeway
FireText
1.0
false
FireText@hiqulabs.com
Read It Later
2.1.3
false
isreaditlater@ideashower.com
Text Area Resizer and Mover
1.82
false
{bc7030f4-a50b-464f-9bff-45a3a9e97125}
Modified Preferences
Name
Value
accessibility.typeaheadfind
true
accessibility.typeaheadfind.flashBar
0
browser.history_expire_days.mirror
180
browser.history_expire_days_min
90
browser.places.importBookmarksHTML
false
browser.places.importDefaults
false
browser.places.leftPaneFolderId
-1
browser.places.migratePostDataAnnotations
false
browser.places.smartBookmarksVersion
2
browser.places.updateRecentTagsUri
false
browser.startup.homepage
http://www.tampabay.com
browser.startup.homepage_override.buildID
20110902133214
browser.startup.homepage_override.mstone
rv:6.0.2
browser.tabs.tabMaxWidth
250
browser.tabs.tabMinWidth
100
browser.tabs.warnOnClose
false
browser.zoom.full
false
dom.disable_window_flip
false
extensions.lastAppVersion
6.0.2
font.default.x-western
sans-serif
font.name.sans-serif.x-western
Verdana
font.name.serif.x-western
Georgia
font.size.variable.x-western
14
general.useragent.extra.betterprivacy
network.cookie.lifetimePolicy
2
network.cookie.prefsMigrated
true
network.protocol-handler.warn-external.itms
true
places.database.lastMaintenance
1316027324
places.history.expiration.transient_current_max_pages
96636
places.last_vacuum
1292534043
print.macosx.pagesetup-2
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VO…
print.print_bgcolor
true
print.print_bgimages
true
print.print_command
print.print_downloadfonts
false
print.print_evenpages
true
print.print_footerleft
print.print_footerright
print.print_headerleft
print.print_headerright
print.print_in_color
true
print.print_margin_bottom
0.5
print.print_margin_left
0.5
print.print_margin_right
0.5
print.print_margin_top
0.5
print.print_oddpages
true
print.print_orientation
0
print.print_page_delay
50
print.print_pagedelay
500
print.print_paper_data
0
print.print_paper_height
11.00
print.print_paper_size
738776616
print.print_paper_size_type
1
print.print_paper_size_unit
0
print.print_paper_width
8.50
print.print_printer
print.print_reversed
false
print.print_scaling
1.00
print.print_shrink_to_fit
true
print.print_to_file
false
print.print_unwriteable_margin_bottom
56
print.print_unwriteable_margin_left
25
print.print_unwriteable_margin_right
25
print.print_unwriteable_margin_top
25
privacy.clearOnShutdown.cookies
false
privacy.clearOnShutdown.extensions-sessionmanager
false
privacy.clearOnShutdown.formdata
false
privacy.clearOnShutdown.history
false
privacy.clearOnShutdown.offlineApps
true
privacy.cpd.cookies
false
privacy.cpd.formdata
false
privacy.cpd.sessions
false
privacy.donottrackheader.enabled
true
privacy.item.history
false
privacy.sanitize.migrateFx3Prefs
true
privacy.sanitize.promptOnSanitize
false
privacy.sanitize.sanitizeOnShutdown
true
privacy.sanitize.timeSpan
0
security.disable_button.openDeviceManager
false
security.warn_viewing_mixed
false
Graphics
Adapter Description
0x24000,0x20400
WebGL Renderer
Intel Inc. -- Intel GMA 950 OpenGL Engine -- 1.4 APPLE-1.6.36
GPU Accelerated Windows
0/1. Blocked for your graphics card because of unresolved driver issues.

finitarry 251 solutions 3421 answers

I tried that resize bookmarklet. It does not work. I used bookmarklets that change the colours on web pages, and those do work. Perhaps there is something about that code that Firefox does not recognize as valid?

I tried that resize bookmarklet. It does not work. I used bookmarklets that change the colours on web pages, and those do work. Perhaps there is something about that code that Firefox does not recognize as valid?
Matt Brubeck 145 solutions 1390 answers

The resize bookmarklets are broken because of this change: Bug 565541 - Web sites shouldn't be allowed to resize main window

I don't know of a way to make the bookmarklets work again, but here's an add-ons that might help instead: https://addons.mozilla.org/en-US/firefox/addon/firesizer/

The resize bookmarklets are broken because of this change: [https://bugzilla.mozilla.org/show_bug.cgi?id=565541 Bug 565541 - Web sites shouldn't be allowed to resize main window] I don't know of a way to make the bookmarklets work again, but here's an add-ons that might help instead: https://addons.mozilla.org/en-US/firefox/addon/firesizer/

Question owner

Glancing at the Firesizer page on addons.mozilla.org, it's not even compatible with Firefox 7. From what I can tell at first glance, it doesn't seem to reposition windows, anyway.

Surely someone knows a way to get this function back — I can't believe anyone would think it a good idea to just sweep away bookmarklets. Upgrading to Firefox 7 isn't even a question for me until I can figure this out.

Glancing at the Firesizer page on addons.mozilla.org, it's not even compatible with Firefox 7. From what I can tell at first glance, it doesn't seem to reposition windows, anyway. Surely someone knows a way to get this function back — I can't believe anyone would think it a good idea to just sweep away bookmarklets. Upgrading to Firefox 7 isn't even a question for me until I can figure this out.

Question owner

The bookmarklets I've been using essentially follow this format:

javascript:moveTo(1,1);resizeTo(1260,screen.availHeight)

They work fine in Firefox 6.0.2, but not in 7 — apparently because someone thought it was a "bug" that someone should want to use bookmarklets to set up their work environment: Bug 565541 - Web sites shouldn't be allowed to resize main window

The bookmarklets I've been using essentially follow this format: javascript:moveTo(1,1);resizeTo(1260,screen.availHeight) They work fine in Firefox 6.0.2, but not in 7 — apparently because someone thought it was a "bug" that someone should want to use bookmarklets to set up their work environment: [[Bug 565541 - Web sites shouldn't be allowed to resize main window]]
Hasan 469 solutions 5600 answers

-> click Firefox button and click Preferences (Options) -> Content panel -> place Checkmark on Enable JavaScript -> click Advanced button -> place checkmark on all Advanced JavaScript settings -> click OK

-> click OK on Options window -> Restart Firefox

Check and tell if its working.

JavaScript

-> click '''Firefox''' button and click '''Preferences''' (Options) -> Content panel -> place Checkmark on '''Enable JavaScript''' -> click '''Advanced''' button -> place checkmark on all Advanced JavaScript settings -> click OK -> click OK on Options window -> Restart Firefox Check and tell if its working. JavaScript * https://support.mozilla.com/en-US/kb/JavaScript * http://kb.mozillazine.org/JavaScript
cor-el
  • Top 10 Contributor
  • Moderator
17415 solutions 157309 answers

You can run this code in the Firefox > Web Developer > Error Console and click the Evaluate button.


var Cc=Components.classes, Ci=Components.interfaces;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
var nb = wm.getMostRecentWindow("navigator:browser");
nb.window.moveTo(1,1);nb.window.resizeTo(1260,screen.availHeight);
You can run this code in the Firefox > Web Developer > Error Console and click the Evaluate button. ----- <pre><nowiki>var Cc=Components.classes, Ci=Components.interfaces; var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); var nb = wm.getMostRecentWindow("navigator:browser"); nb.window.moveTo(1,1);nb.window.resizeTo(1260,screen.availHeight);</nowiki></pre>
blel 1 solutions 3 answers

These advanced javascript settings were already clicked. Still did not work.

These advanced javascript settings were already clicked. Still did not work.
blel 1 solutions 3 answers

Your code did work when "evaluated", but how do you get that code in to menu bar?

Your code did work when "evaluated", but how do you get that code in to menu bar?
cor-el
  • Top 10 Contributor
  • Moderator
17415 solutions 157309 answers

You can't, you can only run that code via the Error Console or via an extension (Keyconfig, custom buttons, mouse gesture) that has elevated privileges to run code at chrome level.

You can't, you can only run that code via the Error Console or via an extension (Keyconfig, custom buttons, mouse gesture) that has elevated privileges to run code at chrome level.
zuzzabuzz 0 solutions 1 answers

Helpful Reply

in the url bar, enter "about:config" and filter for the key "services.sync.prefs.sync.dom.disable_window_move_resize" and change that value to false to get the old behavior back.

in the url bar, enter "about:config" and filter for the key "services.sync.prefs.sync.dom.disable_window_move_resize" and change that value to false to get the old behavior back.
cor-el
  • Top 10 Contributor
  • Moderator
17415 solutions 157309 answers

That is the pref that sync uses to synchronize prefs: services.sync.prefs.sync.dom.disable_window_move_resize

You need the main pref dom.disable_window_move_resize to have effect in your current Firefox profile.
This makes you vulnerable to websites that change the current browser window.

That is the pref that sync uses to synchronize prefs: services.sync.prefs.sync.dom.disable_window_move_resize You need the main pref dom.disable_window_move_resize to have effect in your current Firefox profile.<br /> This makes you vulnerable to websites that change the current browser window.

Question owner

Thanks, cor-el, that looked like it was working great — until it stopped working at all. (At exit/relaunch, maybe?) I've got dom.disable_window_move_resize and services.sync.prefs.sync.dom.disable_window_move_resize both set to "false" currently, and my JavaScript moveTo and resizeTo bookmarklets still aren't working.

For what it's worth, I don't think vulnerability is an issue, in my case. My moveTo and resizeTo bookmarklets were working right up through FF 6.0.2, and I never experienced any problems with websites changing my browser windows. (I'll bet 85-90 percent of my time in Firefox is spent using my newspaper company's in-house Web publishing CMS thin client, tho', so I don't imagine I'd hit many abusive sites, anyway.)

Thanks, cor-el, that looked like it was working great — until it stopped working at all. (At exit/relaunch, maybe?) I've got dom.disable_window_move_resize and services.sync.prefs.sync.dom.disable_window_move_resize both set to "false" currently, and my JavaScript moveTo and resizeTo bookmarklets still aren't working. For what it's worth, I don't think vulnerability is an issue, in my case. My moveTo and resizeTo bookmarklets were working right up through FF 6.0.2, and I never experienced any problems with websites changing my browser windows. (I'll bet 85-90 percent of my time in Firefox is spent using my newspaper company's in-house Web publishing CMS thin client, tho', so I don't imagine I'd hit many abusive sites, anyway.)

Modified by mgrad92

rawzed 0 solutions 1 answers

This is not a bug but a feature.

I use this FEATURE in all my in-house apps, from accounting, billing, client records, reports, testing of websites, personal websites, hundreds of thousands lines of code.

Why would you remove a feature and not make a way for the end user to override the setting and let the USER choose to have a feature.

If all manufactures of products tried to "protect" their clients from harm you would not be able to do much.

Anything can be used for purposes that they are not designed or intended for. But that is up to the end user not necessarily the manufacturer.

I use the web browser more for in-house apps for cross-computer-operation system-versions compatibility. It is faster and easier that writing code in C# or VBS to create a useful application.

As for malicious websites, I know they are out there, have visited a couple, but with all the new features of anti-virus software screening websites before you visit has greatly reduced those attacks.

And for every lock there will be a expert locksmith.

So, again why are YOU choosing for ME to stop or not allow a function that is more useful than harmful? Did I promote you to a person that has control of my life?

I will be downgrading to version 6 and staying there until a sane resolution to this problems is made, if at all...

This is not a bug but a feature. I use this FEATURE in all my in-house apps, from accounting, billing, client records, reports, testing of websites, personal websites, hundreds of thousands lines of code. Why would you remove a feature and not make a way for the end user to override the setting and let the USER choose to have a feature. If all manufactures of products tried to "protect" their clients from harm you would not be able to do much. Anything can be used for purposes that they are not designed or intended for. But that is up to the end user not necessarily the manufacturer. I use the web browser more for in-house apps for cross-computer-operation system-versions compatibility. It is faster and easier that writing code in C# or VBS to create a useful application. As for malicious websites, I know they are out there, have visited a couple, but with all the new features of anti-virus software screening websites before you visit has greatly reduced those attacks. And for every lock there will be a expert locksmith. So, again why are YOU choosing for ME to stop or not allow a function that is more useful than harmful? Did I promote you to a person that has control of my life? I will be downgrading to version 6 and staying there until a sane resolution to this problems is made, if at all...
macknife 0 solutions 1 answers

I've seen a web site that alters the window size ... annoying.

Bank of America has a "help us now by completing a survey" button, which I click accidentally once in a while. It opens a survey in a pop-up window. But I have FF set to open pop-ups (at least those that are not blocked) in another tab ... not a pop-up window. The web site doesn't know that, so when it resizes the pop-up-that's-really-just-a-tab, it resizes the whole window.

That's annoying. So it's nice to NOT have this behavior in FF v7. But, like others, I have a resize bookmark ... and it stopped working. So I reverted to FF 6.0.2. I'll tolerate the occasional Bank of America flub in order to regain my resize button.

I've seen a web site that alters the window size ... annoying. Bank of America has a "help us now by completing a survey" button, which I click accidentally once in a while. It opens a survey in a pop-up window. But I have FF set to open pop-ups (at least those that are not blocked) in another tab ... not a pop-up window. The web site doesn't know that, so when it resizes the pop-up-that's-really-just-a-tab, it resizes the whole window. That's annoying. So it's nice to NOT have this behavior in FF v7. But, like others, I have a resize bookmark ... and it stopped working. So I reverted to FF 6.0.2. I'll tolerate the occasional Bank of America flub in order to regain my resize button.
plane007 0 solutions 2 answers

Having a workround that relies on users changing their settings is rubbish. A web site is supposed to be universal.

Surely, it is not beyond the wit of man to offer a browser option like allowing popups! The default can be either way.

Having a workround that relies on users changing their settings is rubbish. A web site is supposed to be universal. Surely, it is not beyond the wit of man to offer a browser option like allowing popups! The default can be either way.
jwarren36 0 solutions 3 answers

Couldn't agree more! This IS - or was! - a FEATURE ... a USEFUL feature. Firefox designers should NOT destroy this perfectly good - and VERY useful! - feature. Or if they insist on doing so, at least provide a way - e.g. in Preferences - for us to restore this feature that we didn't want to loose in the first place!

Couldn't agree more! This IS - or was! - a FEATURE ... a USEFUL feature. Firefox designers should NOT destroy this perfectly good - and VERY useful! - feature. Or if they insist on doing so, at least provide a way - e.g. in Preferences - for us to restore this feature that we didn't want to loose in the first place!
jwarren36 0 solutions 3 answers

Thanks zuzzabuzz. But there's something else going on that's even more bizarre: 1. Went to about:config and switched services.sync.prefs.sync.dom.disable_window_move_resize to false as you suggested. Thereafter, javascript window resizing DID work. Until I quit and restarted - at which it stopped working. 2. Again went to about:config. Without doing ANYTHING else - javascript window resizing started working again. Until I quit and restart. BIZARRE!

Thanks zuzzabuzz. But there's something else going on that's even more bizarre: 1. Went to about:config and switched services.sync.prefs.sync.dom.disable_window_move_resize to false as you suggested. Thereafter, javascript window resizing DID work. Until I quit and restarted - at which it stopped working. 2. Again went to about:config. Without doing ANYTHING else - javascript window resizing started working again. Until I quit and restart. BIZARRE!
thierry.l 0 solutions 1 answers

The problem seems to be related to Firebug, no more problems after disabling. Firebug 1.8.3 / FF7.0.1 / Windows XP

http://code.google.com/p/fbug/source/detail?r=11993 fixe is fine

The problem seems to be related to Firebug, no more problems after disabling. Firebug 1.8.3 / FF7.0.1 / Windows XP http://code.google.com/p/fbug/source/detail?r=11993 fixe is fine

Modified by thierry.l

iph1 0 solutions 1 answers

Helpful Reply

This change is a design defect. So-called bug 565541 "Web sites shouldn't be allowed to resize main window" is a false assertion for two reasons:

1) it is a feature of Javascript that the browser window can be resized and repositioned. 2) There is no formal definition of "main" window. There can be multiple windows, and a script run in one can open another; that makes "parent" and "child" window relationships but there is no such thing as "main".

My copy, Firefox 7.0.1 which is still the latest according to its "check for updates" has the option to disable resizing or repositioning under Tools | Options | Content | Advanced.

The defect is that enabling move or resize in that Advanced Javascript Settings panel fails. If we also have this "about:config" route to settings, and those are not the same settings as those reached from the panel as above, and the about:config overrides the Advanced Javascript Settings panel, then that is a defect and it must be fixed. It is totally improper for a setting under the control of a normal settings panel in a piece of software to be overridden by a separate hidden setting that does exactly the same thing.

If you want to improve Firefox as regards these powers, by all means add to the number of check boxes on the Advanced Javascript Settings panel.

Instead of just "Allow scripts to [] move or resize existing windows [] raise or lower windows etc."

you might wish to have "Allow scripts to [] move or resize the existing window they are running in [] move or resize existing windows other than the one they are running in [] open, move and resize new (popup) windows [] raise or lower windows etc."

However to leave the Advanced Javascript Settings panel with the options it still has but to ignore its settings is totally wrong and it was unacceptable for Firefox 7.0.1. to have gone out like this.

This change is a design defect. So-called bug 565541 "Web sites shouldn't be allowed to resize main window" is a false assertion for two reasons: 1) it is a feature of Javascript that the browser window can be resized and repositioned. 2) There is no formal definition of "main" window. There can be multiple windows, and a script run in one can open another; that makes "parent" and "child" window relationships but there is no such thing as "main". My copy, Firefox 7.0.1 which is still the latest according to its "check for updates" has the option to disable resizing or repositioning under Tools | Options | Content | Advanced. The defect is that enabling move or resize in that Advanced Javascript Settings panel fails. If we also have this "about:config" route to settings, and those are not the same settings as those reached from the panel as above, and the about:config overrides the Advanced Javascript Settings panel, then that is a defect and it must be fixed. It is totally improper for a setting under the control of a normal settings panel in a piece of software to be overridden by a separate hidden setting that does exactly the same thing. If you want to improve Firefox as regards these powers, by all means add to the number of check boxes on the Advanced Javascript Settings panel. Instead of just "Allow scripts to [] move or resize existing windows [] raise or lower windows etc." you might wish to have "Allow scripts to [] move or resize the existing window they are running in [] move or resize existing windows other than the one they are running in [] open, move and resize new (popup) windows [] raise or lower windows etc." However to leave the Advanced Javascript Settings panel with the options it still has but to ignore its settings is totally wrong and it was unacceptable for Firefox 7.0.1. to have gone out like this.
David McRitchie 320 solutions 3092 answers

services.sync.prefs.sync.dom.disable_window_move_resize set to false

suggested by zuzzabuzz works if you click on a bookmark, but is useless for invoking keyword shortcuts at the location bar. Putting 27 resize bookmarklets into a folder as a drop-down menu on bookmarks bar where they can have full titles is not much of a solution. One of my reasons for switching to Firefox was to remove limitations on bookmarklets (IE limited size), I did not switch to Firefox because I wanted to compromise.

'''services.sync.prefs.sync.dom.disable_window_move_resize set''' to '''false''' suggested by zuzzabuzz works if you click on a bookmark, but is useless for invoking keyword shortcuts at the location bar. Putting 27 resize bookmarklets into a folder as a drop-down menu on bookmarks bar where they can have full titles is not much of a solution. One of my reasons for switching to Firefox was to remove limitations on bookmarklets (IE limited size), I did not switch to Firefox because I wanted to compromise.

Modified by David McRitchie