Javascript Bookmark to resize Safari Windows

Despite searching all over, I could not easily find how to keep Safari from opening new windows that were just a bit off on the left or the right sides of the screen. I had read tips about making a new window, resizing it and then closing it. Sure enough, the next new window would open with that size and position. But open a 2nd new window and Safari would position it a little bit to the right, thus leaving the scroll bars slightly off the right side of the screen.
So I tried to find a javascript to solve this problem. Nothing did exactly what I wanted, so I have customized what I found and the following works for me:
Step 1) Save any webpage as a bookmark to the Bookmarks Bar (Click "Bookmarks" then "Add Bookmark...", OR Click Apple-D, then choose "Bookmarks Bar", "Add").
Step 2) Open "Bookmarks" "Show All Bookmarks", then choose "Bookmarks Bar" on the left under "COLLECTIONS".
Step 3) Find the bookmark you added in Step 1 and change the Bookmark's name to "Resize Window to Fill screen" or whatever you want (click once on the name and after a delay click a second time, then type).
Step 4) Change the bookmark's address to "javascript:self.moveTo(0,0);self.resizeTo(1440,screen.availHeight);" (click once on the bookmark's address and after a delay click a second time, then type or copy and paste what is inside the quotation marks above).
Step 5) In any window, click Apple-1 and the window will resize!
Note: I have a 17" iMac. For different size screens, just play around with the number "1440" in the javascript above. Make it larger or smaller until it is the exact size you want. Also, if you add new bookmarks to the Bookmarks bar, it may change the keyboard shortcut number for this "Resize Window" bookmark. You can always drag to reorder the bookmarks. The top ones will have keyboard shortcuts "Apple-1", "Apple-2", etc.
Hope this helps someone else!

This helped me, and thanks again!!

Similar Messages

  • Resize safari window question

    Every time i open safari i have to drag the window over to the left so i can see the scroll bar and then i have to resize the window to fit the screen. How can i fix it so the window is always centered and fills the screen whenever i open safari?

    You're misunderstanding this. The "Resize to Full Screen" text is a Bookmarklet; you click and drag it to your Bookmark Bar in Safari, then click on it from there to resize your screen. But apparently those don't work in the forums, so here's the raw code:
    javascript:self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);
    Create a new Bookmark (copy one if you need to just to get the necessary fields in Safari without creating a folder), copy/paste that code for the Location or URL field, then place it on your Bookmark Bar.
    Mulder

  • Resizing Safari Window causes blank space

    When I resize a safari window using the corner (bottom right) it leave a blank space if I make he page bigger and doesnt fill the page at all unless i press refresh.

    .oO(CJR 2007)
    >I'm pretty new to website design and this might seem very
    basic, but how is it
    >possible to resize a browser window automatically to fit
    the content on my page
    >using Dreamweaver CS3?
    You should rather make the site fit the browser window.
    > The content of my page is 700px by approximately 650 but
    I want the browser
    >window to show just this content and not the blank space
    surrounding it.
    Resizing the browser window is considered _very_ rude, if it
    will work
    at all - modern browser prevent such abuse of JavaScript.
    You should more concentrate on the content and the usability
    of the site
    to attract visitors. Keeping the layout flexible is usually
    the best way
    to go. But even if it has to be a fixed-width layout, you
    shouldn't mess
    with the user's browser settings, but for example center the
    entire site
    in the browser. Solutions for that are posted here every
    second day.
    Micha

  • Cannot resize safari window

    i can't resize the safari window by hovering over the bottom right corner of the window. I am working on a Macbook Pro and Yosemite.
    thanks!

    When you hover over the corner do you not see the cursor change to a slanted heavy line with arrows at each end? Do you then click down and then resize the window?

  • I want to add javascript Bookmark function for Safari with out any alert

    I have already searched this forum but it seems discussions related to my question are very old. (latest was posted in 2008). I was wondering if there is any solution for this now. Thanks in advance.

    Premiere Elements doesn't have a timecode counter embedded into the program.
    But this free utility may help.
    http://paul.glagla.free.fr/dvdate_en_installer.htm

  • Safari window not resizing

    I am running Safari 5.1.9 on OS X 10.6.8.  For the last few days, Safari windows always open at exactly the same size, and there is nothing I can do to resize them.
    The resize button in the bottom right corner doesn't respond.  The green maximise button on the top left doesn't do anything.
    I have tried:
    * restarting
    * forcing Safari to open links in a new window
    * emptying Safari's cache
    * resetting Safari
    * trashing Safari's preferences
    * turning off all plugins
    * trashing com.apple.windowserver.plist
    * starting Safari in 32-bit mode
    * beating my head slowly against the screen
    This seems to be a problem only with one user.  When I switch to another user, Safari behaves itself very well.
    My system software is up to date.
    Any ideas?

    Try deleting the cache this way. Might make a difference.
    In the effected account, open a Finder window. From the menu bar top of your screen click Go > Go to Folder
    Type of copy paste the following:
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari and try resizing the window.

  • How do webpage developers get Firefox to use the windows.resize or windows.moveTo javascript functions that seem to now be passed over?

    Before V7, this code worked and did as requested every time the page was run. Now, it does not work and no error is reported. Google Chrome and Internet Explorer are able to produce th correct result.
    <script type="text/javascript">
    window.resizeTo(325,700);
    window.moveTo(1150,10);
    </script>
    I have a site where I use window.open to create a login window with minimum chrome.
    On successful login, the window that created the login window updates itself to another page. The login window is supposed to resize itself and move to create a console panel to the right of the screen.
    I have tried to update the window from its parent at the point of successful login (flagged by a database change, checked frequently). I have also included code in the new window itself to resize itself to no avail.
    The new code seems to be failing on both the conditions laid out!

    Some conditions were added in 7.0 to avoid abuse of the resize and move functions:
    #Can't resize a window/tab that hasn't been created by window.open.
    #Can't resize a tab if the tab is in a window with more than one tab.
    * https://bugzilla.mozilla.org/show_bug.cgi?id=565541#c24
    There's still some discussion on the bug - including some solutions and troubleshooting for pages that were affected that shouldn't be - and it's being tracked to make sure it doesn't have any adverse effects.

  • Using javascript to resize the window

    I've got a project that I would like to resize depending on which slide the learner is viewing.
    I' aware that the javascript method:
    window.resizeTo(width,height)
    can be used to resize a window.
    In my case I want it to be for the tall window:
    window.resizeTo(1016,650)
    and for the short window;
    window.resizeTo(1016,165)
    I'm also aware that you can tell a button (or anything else) to execute javascript.
    I'm having trouble making it work, tough.
    I've tried putting the method directly into the Script_Window for the button.
    I've tried writing a function in the published file, then having the button call that function.
    Can you paste javascript snippets into the Script_Window? Or do you need go the whole 9 yards and write the entire function, name the button instance, and tell the Captivate button to call that function?
    I'm just now sure how much Captivate knows how to do and how much I need to tell it.
    Thanks in advance!
    Joe           

    Thanks for your response, Jim.
    My window was created by a previous window using the code:
    <script language="JavaScript">
    function newWindow() {
    TheNewWin = window.open("main.htm","newWin","status=no,resizable=yes,left=0,top=0,width=1014,height=6 50");
    TheNewWin.focus()
    </script>
    I tried the code above in the ScriptWindow of a Captivate button (running in a Captivate SWF in the new window). It didn't work.
    I also tried:
    TheNewWin.resizeTo(1016,165);
    and
    newWin.resizeTo(1016,165);
    neither of which worked.
    Any other guidance would be appreciated.

  • Dragging Safari bookmarks to open Finder windows doesn't work.

    When you drag a URL from the top of a Safari window to a window in the Finder, a bookmark ("web internet location") file is supposed to be created. Since I upgraded to Yosemite, this has worked only sporadically. Now the URL just flies right back to its origin at the top of the Safari window. (Dragging a URL to an icon of a folder works fine, however.)

    But when I eject the CD, then mount it again, Finder gives me a mess of one-on-top-of-the-other icons all over again
    Of course it will.
    The CD is read-only - it can't be written to. Since the window position, view settings, layout, etc. are stored in the directory, there's no way for the Finder to write the changed settings back to the disk before you eject it.
    The issue occurs because what you're seeing is how the window was laid out when the disk was burned in the first place.
    Your solution is to re-burn the disk, positioning the icons where you want them before starting the burn.

  • Javascript in Safari - Windows n iMac

    How different is Javascript behaviour in Safari - Windows and Safari - iMac?? 

    What do you mean? Javascript is javascript. Javascript is not written for a specific browser or OS. I think if you are seeing differences in page layout it has more to do with how the browser handles CSS and HTML rather than how it handles javascript.
    A quick Google search for "windows safari javascript vs Mac" will yield several comparisons.

  • Saved tabs menu bookmark brings Safari window to unusable state

    Saved tabs menu bookmark does not ask for user confirmation when navigating away from many tabs, and when the user returns to the previous set of tabs (note that this possibility isn't clear to the user), the entire Safari window reaches an unusable state.
    I have a saved tabs folder as a bookmark item that is also present on the bookmarks menu bar. That means if I accidentally click on the saved tabs link instead of the address bar then my Safari session with all of the current active tabs disappears! I'd like to suggest that Safari presents a confirmation page when the user is about to change the state of more than one tab, just like it would ask for confirmation if the user were to exit Safari or close a window with many open tabs. By clicking on that single button nearby to the address bar, the entire window state is altered, not just the current tab. That's not my initial expected behaviour. On the other hand, it was also not clear to me initially that I could navigate back to the previous set of tabs when that state is comprehensively changed. So maybe the user can be informed about the ability to undo that action. For now, I will certainly be moving that set of tabs away from the menu bar, tucked further within the Bookmarks menu. But the problem that I have now is more than just a temporary unavailability of the old state.
    When I accidentally navigated forward to that set of tabs, and subsequently quickly hit the back arrow button to revert to the previous state, Safari itself reached a point where the content of all tabs became unavailable. This sounds like it could be a kind of race condition where Safari needs to throw away cached information for the old set of tabs before it builds new cached information upon loading all new tabs. By aborting the process of loading those new tabs, maybe Safari assumes that the set of tabs is up to date, but the transition back to the old set of tabs doesn't appropriately trigger a reload and revert of the state. In any case the symptom is clear. When I switch between tabs in the problematic window, I continue to get completely blank screens even though I had many distinct tabs open in that window initially. It seems that to reproduce this problem what needs to be done is to have this set of saved tabs in a bookmark that is stored just below the address bar, and then to quickly navigate backward to return to the previous state. The more tabs in the current and stored session, the more this process may bog down Safari and expose this type of race condition. I also believe I may have also double or triple clicked that saved tabs button, which may invalidate the original set of tabs since the state for several sets of tabs might not be stored transparently by default. In any case I would like to recommend that Safari warn the user when this step takes place. The user could even be warned because they place a set of tabs bookmark below the menu bar, since they might accidentally click there. When this problem occurred, the other Safari window I had open had multiple tabs but this part of the Safari session was considered still working and the symptoms were not there. Yet the problematic window continues to experience the problem where all tabs are currently blank. I believe that I'll have to restart Safari to trigger the reloading of the pages, but I don't even know if that will be sufficient. I hope that this information is helpful.

    xb37835dd237610f1 wrote:
    In any case I would like to recommend that Safari warn the user when this step takes place.
    Recommend to whom? Discussions is a user-to-user forum. You are just talking to other users. We don't write the applications so we can't change how they work.
    If you have what you believe to be a product improvement idea, send it to Apple via the feedback URL. Posting it here is pointless.

  • How do I set Safari to automatically resize new window when opening a link?

    Here is the scenario. I have one Safari window open, I click a link that is on that page, I have Safari set to open a new window (not a new tab) so that is what it does. It opens a new window from that link, but the new window is too small. It is about 1/4 the size of a window that fills up the screen. How do I set up Safari so that when I open a link in a window, it automatically resizes the new window to fill the screen?
    Thanks much,
    Paula Jo

    Hi Paula Jo
    Next time a new window automatically opens, resize it to the desired size by dragging the lower right corner. Then, click on the red button in the upper left to close it.
    Now, select a link in your existing browser window to open the 2nd window. It ought to be the same size as what was set previously.
    Let me know if that works.

  • When i open up a new safari window (command N), and i hover my cursor over my bookmark bar, the bar retracts. but this does not occur on the initial safari window.

    this issue happens with all additional safari windows except the primary one opened.  I think it is a small software glitch, but id like apple to know so they can update it.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you boot, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

  • Safari window won't fill the 24" imac screen - accidentally did something

    I accidentally did something and now the screen is more 8x10. Using the +/- buttons do not resize to full screen. I am running 10.4.11. Any ideas?

    The "+" and "-" buttons aren't for resizing a window; they're for resizing text on the page. If you want to be able to "maximize" your browser window, try this:
    Create a new bookmark (doesn't matter what site or page you use for that)
    Choose Show All Bookmarks from the Bookmarks menu and locate that new bookmark.
    Highlight the name of the bookmark and change it to "Full" or "Full Screen" or something similar.
    Highlight the URL of the bookmark and change it to this:
    javascript:self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);
    Then restart Safari and try it out; it should work flawlessly.

  • Size and position of Safari windows

    I don't think anyone's noticed the problem discussed at the end of a thread, outlined here:
    K H N Lim, "Enlarge Window Size" #3, 01:44pm Jul 28, 2005 CDT
    It's a problem a lot of people (okay, four of us) are having. Quick summary:
    "I launch Safari, resize the window and position it at the upper lefthand corner. Quit Safari and relaunch. Initially the window stays put, but after a while, the position shifts. And keeps shifting more and more toward the right of the screen with each subsequent launch."
    I've had the same problem and it makes it hard to switch from one app to another, with Safari shifting all over the screen and refusing to remember how it was positioned from launch to launch. Any ideas what's up?

    I used to be bugged by this too. Then I saw a message from someone who suggested the following applescript (with changes to coords to match your screen size and position you want). Mine is set for 1600 x 1024 resolution on my 22" cinema display. The coords are for top left corner and bottom right corner of the Safari window.
    Make a new bookmark, i.e. press COMMAND-D
    Specify that it should go in the bookmarks bar.
    Go to the bookmarks screen in Safari.
    Find the bookmark.
    Select the name (left side) and edit it to something like Window Position.
    Select the URL (right side) and paste in (without the quotes)
    "javascript:self.moveTo(190,0);self.resizeTo(1150,995)"
    Close the bookmarks window/screen.
    Click on "Window Position" in the bookmarks bar and the window will resize to specified size and position.

Maybe you are looking for

  • Can't reinstall/repair Acrobat 9 Std w/ disk & serial #

    I bought a Dell Latitude laptop a few years back, and it came with a copy of Adobe Acrobat 9 Standard installed on it. Recently I've started having several issues with the software (it crashes just about everytime I try to open a PDF file), so I deci

  • Cannot install new version of iTunes

    I cannot install the newest version of iTunes due to cpu not finding "iTunes.msi"

  • Open Hub Destination - SAP CRM

    Hi, We would like to transfer bulk data from SAP BI (Data Store Object) into SAP CRM. Performance of APD has been very poor. As an alternative, we are checking the feasibility of using InfoSpoke/Open Hub service to transfer data from data store objec

  • Kernel panic during Leopard 10.5.3/4 net-installation

    Hi, We have built universal Leopard images on net-install server. I am getting kernel panic during net-installation of 10.5.3 and 10.5.4 images on old iMac bubble G4 machines. These images's net-installation works perfect on latest machines like G5,

  • Can I write a booklet using pages?

    Can I write a booklet using Pages   Laid out side by side and front and back pages