[UserJS] Stop resizing of pages on the MyOpera Forums if the available width on a computer screen is smaller than 921px

Forums » General Opera topics » User JavaScript

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

14. May 2010, 16:47:44

Tomcat76

Posts: 4488

[UserJS] Stop resizing of pages on the MyOpera Forums if the available width on a computer screen is smaller than 921px

The people working on the MyOpera Forums page have recently introduced a change into the way the forums are being displayed. When the available width is 920px or less, the forum will be displayed in a narrower fashion.

The problem is that, when the monitor of the user actually allows the wider forum layout to be displayed, but the Opera window is narrower on page load, and you then enlarge the Opera window, the layout won't automatically change to the wider version; it will remain at the narrower version.

This script alters the "media" attribute of the targeted "style" element on these web pages so that this resizing does not occur on regular computer screens.

I made a similar script just a while ago but found it too dirty, and the delay annoying. This newer script is cleaner and works instantly.

TC76_MyOperaForums_Don't_Resize.js
Tomcat "the farce is mine" 76 | WinXP Pro 32bit · JRE 7u21 · Default UA: Opera 9.27 (file extensions in cache & Google Images layout) | My computer | Download different Opera versions

15. May 2010, 14:53:36

Tomcat76

Posts: 4488

Newer, cleaner version.
Tomcat "the farce is mine" 76 | WinXP Pro 32bit · JRE 7u21 · Default UA: Opera 9.27 (file extensions in cache & Google Images layout) | My computer | Download different Opera versions

16. May 2010, 11:28:25

Kani

Posts: 120

Funny, I found that if you enlarge the window fast the page will resize, but if you do it slowly it won't.

Like, first drag the right edge to the left until the layout is resized to the smaller version.
Then slooowly drag it to the right, it won't resize.
Now drag it to the left again then move it fast to the right and the layout will resize.

That's without your script.

16. May 2010, 13:25:18 (edited)

Tomcat76

Posts: 4488

That doesn't seem to work for me, but I'm using Opera 9.27. That could be the reason.

The problem for me (the reason I created this script for myself) is that, when multiple, "smaller" Opera windows are opened, and I want to open yet another new window, Opera uses the dimensions of the first window that was opened for that new window, instead of using the dimensions of the window from which the new window is initiated.

Test:
1) Open one Opera window and resize it so it's about 5cm by 5cm
2) Go to File > New Window; it will be 5cm by 5cm, but that's normal
3) Resize the new window so it spans almost the entire screen
4) In this larger window, go to File > New Window

This new window is sized 5cm by 5cm. If it were sized with the same dimensions of the window from which it was initiated, I wouldn't have to create this script for the Opera Forums.

I often open links in a new window, especially on YouTube. You can imagine how annoying it is to always have to resize the window after opening it. Couple that with the problem that you can't change the dimensions of Opera windows by dragging the bottom right corner as with any other program on Windows (the dragging point to be able to drag both to the right and to the bottom simultaneously is much higher in Opera), then I missed enough of the YouTube video that I need to restart it.

Maybe it's time for a more global UserJS that works around this... smile
Tomcat "the farce is mine" 76 | WinXP Pro 32bit · JRE 7u21 · Default UA: Opera 9.27 (file extensions in cache & Google Images layout) | My computer | Download different Opera versions

16. May 2010, 16:17:50

Tomcat76

Posts: 4488

Updated.

Seems Opera 9.5 and later don't include *.dml?* pages with a "*.dml" rule, as opposed to Opera 9.2 and earlier.
Tomcat "the farce is mine" 76 | WinXP Pro 32bit · JRE 7u21 · Default UA: Opera 9.27 (file extensions in cache & Google Images layout) | My computer | Download different Opera versions

19. May 2010, 07:03:51

nowotny

Posts: 1296

Originally posted by Tomcat76:

This new window is sized 5cm by 5cm. If it were sized with the same dimensions of the window from which it was initiated, I wouldn't have to create this script for the Opera Forums.


This really looks like a bug... did you report it...?

Forums » General Opera topics » User JavaScript