Bookmarklet to fit window to contents
8 posts
• Page 1 of 1
I was searching for a bookmarklet that is able to adjust the window size of the browser to the actual contents in the current webpage. I saw some bookmarklets that adjust the size to a given one, but no solution that is able to adjust to the size needed to show the current content in a compact way (without leaving unused space in the window). For example at https://www.20minutes.fr/ if you window's size is large you will see a large amount of unused space on the right and left, that you can avoid my manually resizing the window.
![]() Bookmarklet Fit to Width How to Ask Questions The Smart Way - How to Report Bugs Effectively
![]() Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20210118 SeaMonkey/2.53.6 Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20210124 SeaMonkey/2.53.7 Thank you very much, that is an interesting approach. However, I was looking for the opposite kind of solution: instead of enlarging the content to fit the width of the window, I would like to adjust the width of the window according to the actual content.
There are some restrictions on scripts resizing windows in Firefox. Click the little box under Firefox for a compatibility note:
https://developer.mozilla.org/docs/Web/API/Window/resizeTo#Browser_compatibility Thank you for the tip. Then I think that it could be possible if the bookmarklet opens the current tab again in a new window (with window.open) and then resizes it.
![]() How to Ask Questions The Smart Way - How to Report Bugs Effectively
![]() Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20210118 SeaMonkey/2.53.6 Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20210124 SeaMonkey/2.53.7
I haven't tried that myself, but it sounds like it is worth a shot if that wouldn't a problem on that site. I found this, which works well even though it is not a bookmarklet:
resizemybrowser.com I'm not sure if I am on the right path because even if I achieve transforming that idea into a bookmarklet then there is the issue of how could I determine the right width size for the given contents in the window. Any idea or suggestion is welcome.
8 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 5 guests |
![]() |