[Q] Opera 10 mobile sites issue

InfX

Senior Member
May 1, 2008
885
216
73
On HD2 with Opera 10 installed, many mobile sites, such as m.wikipedia.org or m.wikitravel.org seem to render on a viewport that is bigger than the actual screen space available. With the "show" buttons on wiki mobile sites being at the right side, this becomes a real nuisance.

Anyone got a solution for this ?

NOTE: The very same sites mentioned render properly on Opera 9.7. Actually, they also render properly on Opera 10 on my older QVGA device, too.
 

InfX

Senior Member
May 1, 2008
885
216
73
My question isnt related to useragent, i dont want to open the full version instead of the mobile sites, i want the mobile sites to open properly ! And, no, i cant find an answer on my question anywhere, otherwise i just wouldn't post.
 

InfX

Senior Member
May 1, 2008
885
216
73
Bump.

To make it easier to understand what i mean, i am attaching 2 screenshots, one with the Opera 10 rendering and one with the proper, Opera 9.7, rendering of the very same page.


* Opera 10 rendering




* Opera 9.7 rendering
 

InfX

Senior Member
May 1, 2008
885
216
73
Come on, i can't be the only one having this problem !
I also did the following test, to avoid any possible link to the useragent. I made the following test html:

Code:
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="initial-scale=1, width=device-width, height=device-height, minimum-scale=1, maximum-scale=1.0, user-scalable=no" />
</head>

<title>Viewport Test</title>

<body>
    <center>***</center>
</body>
</html>
Opening it on opera 9.7 works normally, the "***" is centered on the screen, there is no horizontal scrollbar. On opera 10, though, it appears on the right side of the screen with horizontal scrollbar, like if it would be x2 zoomed !!! Setting the viewport width attribute to 480, directly, results in the same rendering. Setting it to 240 instead results in PROPER rendering, though. Kinda looks like the browser is zooming the page x2 by default, despite having my zoom setting at 100%.

Someone, please point me to the right direction, i really want a fix for this.
 

hagba

Senior Member
Nov 9, 2008
1,340
190
83
Yerevan
Just go to Settings and change Zoom level to anything above 100%,start the page Double tap the screen,tap the ZoomOut at the bottom left you will see the full page,this will not work with 100% setting.
 

InfX

Senior Member
May 1, 2008
885
216
73
Just go to Settings and change Zoom level to anything above 100%,start the page Double tap the screen,tap the ZoomOut at the bottom left you will see the full page,this will not work with 100% setting.
I know about this, found it out myself, too. There are quite a few disadvantages in doing this.

  1. Opera keeps the paragraphs width the same even after zooming out, not using the entire screen space, unless you disable this in about:config, but in this case you get a hard time reading non-mobile versions
  2. The fonts in the "zoomed out" state are way too small, if you enlarge them in settings, again, you screw yourself up in non-mobile site versions browsing.
  3. Having to zoom out, and then zoom back in to click, on the mobile sites, defies the entire purpose of the "mobile version".
This thing is CLEARLY a bug, but it kinda seems like nobody really cares and/or knows any workaround :-(
 

InfX

Senior Member
May 1, 2008
885
216
73
I guess i am not going to receive a real answer on this one, ever :-(

http://www.google.com/reader/i/This issue totally screws sites such as iphone google reader version up. I would use Opera 9.7, but it seems to conflict with the Hebrew support, looks like it either doesn't support bidi, or attempts to do it on it's own, on top of the system bidi support, resulting in reversed Hebrew. Internet explorer, while not having those particular issues, is a total crap at rendering normal, non-mobile sites. Skyfire is no longer servicing middle east. Webkit unavailable for WM, "Torch Mobile" no longer exist. Damn :-(

Any suggestions ?
 

InfX

Senior Member
May 1, 2008
885
216
73
Since nobody provided a real answer and no amount of googling did any good, i am now using my own, userscript based, workaround. Just in case anyone else may need this (doubt it, really), i am sharing it below. I know it's fugly, wrong, etc etc, but as nasty as this code is, this 'fixes' the touch.facebook.com rendering, as well as m.wikipedia and m.wikitravel. IPhone version of google reader is rendering correctly with this, too. So, here we go:

Code:
function fixviewport()
{
    if (document.documentElement)
    {
        var meta_viewport_array = document.getElementsByName("viewport");
        if (meta_viewport_array.length)
        {
            var meta_viewport = meta_viewport_array.item(0);
            meta_viewport.setAttribute('content', "width="+((screen.width+16)/2)+",height="+(screen.height/2));
        }
    }
}

window.addEventListener('DOMContentLoaded',fixviewport,false);
 
  • Like
Reactions: wardh

wardh

Senior Member
Aug 17, 2009
787
118
63
Since nobody provided a real answer and no amount of googling did any good, i am now using my own, userscript based, workaround. Just in case anyone else may need this (doubt it, really), i am sharing it below. I know it's fugly, wrong, etc etc, but as nasty as this code is, this 'fixes' the touch.facebook.com rendering, as well as m.wikipedia and m.wikitravel. IPhone version of google reader is rendering correctly with this, too. So, here we go:

Code:
function fixviewport()
{
    if (document.documentElement)
    {
        var meta_viewport_array = document.getElementsByName("viewport");
        if (meta_viewport_array.length)
        {
            var meta_viewport = meta_viewport_array.item(0);
            meta_viewport.setAttribute('content', "width="+((screen.width+16)/2)+",height="+(screen.height/2));
        }
    }
}

window.addEventListener('DOMContentLoaded',fixviewport,false);
This is great! Thank you for this! This was the main reason I wasn't using OM10 on my HD2.

(I'm using zoom 80% so I changed from "(screen.width+16)/2" to "(screen.width+16)/1.6"...)
 

InfX

Senior Member
May 1, 2008
885
216
73
This is great! Thank you for this! This was the main reason I wasn't using OM10 on my HD2.

(I'm using zoom 80% so I changed from "(screen.width+16)/2" to "(screen.width+16)/1.6"...)
No problem at all :)

TBH, judging by the fact this thread consistently got buried one post after another, with nobody posting anything relevant, i've assumed nobody cares about this issue.

About the 80% or other zooms, any chance you may know a programmatic way of finding the current zoom out. I've did try a few things, but i couldn't find a working method to do this. Another thing i couldn't find is a window event that would fire when the screen is rotated, to avoid the need to reload the page. So if you happened to find any of those, do post an updated script ;)
 

tintoverano

Member
Jun 10, 2009
14
0
0
This is great! Thank you for this! This was the main reason I wasn't using OM10 on my HD2.

(I'm using zoom 80% so I changed from "(screen.width+16)/2" to "(screen.width+16)/1.6"...)
hello guys,

this sounds great, I've just run into this. where do you put/apply this script?

cheers,

tinto
 

Hoe

Member
Jun 21, 2010
8
0
0
Since nobody provided a real answer and no amount of googling did any good, i am now using my own, userscript based, workaround. Just in case anyone else may need this (doubt it, really), i am sharing it below. I know it's fugly, wrong, etc etc, but as nasty as this code is, this 'fixes' the touch.facebook.com rendering, as well as m.wikipedia and m.wikitravel. IPhone version of google reader is rendering correctly with this, too. So, here we go:

Thanks a million InfX for this !!!

Luckily I found your thread here, when I've already given up hope to get this fixed.

I was also wondering nobody else cared about this as there is no other other browser which is any good on WinMo 6.x, especially with the handling and favorites.

Older Opera versions (9.7) are so much slower in the user interface and viewing compared to 10 they are no alternative.
IE Mobile is kinda crappy too.


For all others interested, I also found other places where people talked about this problem

// Sorry can't post URLs ....

But apparently nobody at Opera cared about it at all.
And from what I've seen/read it would be no biggy to fix it
 
Last edited:

Hoe

Member
Jun 21, 2010
8
0
0
Here is an manual for everyone how to get the userscript into Opera 10:

- Create a directory anywhere on your device, e.g. I used:

\Interner Speicher\Opera Mobile 10\profile\scripts\

- Save the script in that directory, e.g. as: fix-viewport.js

- Open Opera Mobile 10 and go to: opera:config

- Enter "javascript" in the searchbox

- change the following values:

Activate: "User JavaScript"
Set: "User JavaScript File" to the folder you created before
Activate: "User JavaScript on HTTPS"

===

That's it. Restart Opera and you will have nicely fitting webpages!!


Edit: Maybe an Admin can put this thread into the general Windows Mobile forums, as the problem is not specific to any device, but all WinMo 6.x with a screen resolution of 480x800
 
Last edited:

VHAHONGRANTC

Member
Sep 30, 2008
18
1
0
Kaneohe
This has just made Opera 10 a million times better!

Hoe,
Thank you for your instructions they were spot on and thanks to the OP's javascript code this works fantastic!
I just recently ran into this with using Twitter's mobile website and was frustrated that Opera 10 did not adjust the width correctly and I always had to horizontal scroll. In addition to other sites that would default to the mobile version, and I would use the "full site" link just to get correct sizing, even though sometimes the mobile site is more convienent. Normally, I like the full websites, but mobile versions DO have their place. ;)

Again, KUDOS to all, this is super-helpful. I have always found Opera 10 to be the superior mobile browser and really this issue was my only problem with it. Now Opera Mobile 10 went from 99% to 100% perfect in my view. :D
 

silverwind

Senior Member
Mar 2, 2010
862
101
0
Neverending Land
Again, KUDOS to all, this is super-helpful. I have always found Opera 10 to be the superior mobile browser and really this issue was my only problem with it. Now Opera Mobile 10 went from 99% to 100% perfect in my view. :D
Due to that additional work, I still prefer to have Opera 9.7 though :D
I hope the cook/devs can cook it into his rom, especially the one that cook opera 10 :rolleyes:

cheers
 

InfX

Senior Member
May 1, 2008
885
216
73
I can't believe someone still finds this thread useful, lol. I went the Android way quite some time ago, making this kinda irrelevant for me :)