We have moved to a new Sailfish OS Forum. Please start new discussions there.
46

[Bug] WebView scale is too small

asked 2013-12-25 16:03:09 +0300

TuukkaH gravatar image

updated 2019-03-08 17:02:21 +0300

Spam Hunter gravatar image

For example, if you compare http://en.m.wikipedia.org/ in the Browser app to the same page in a WebView (such as in the Wikipedia app), the WebView shows the content about 30% smaller making it difficult to read and interact with.

I suppose this is because the WebView is hardcoded with a DevicePixelRatio setting that doesn't match the Browser.

Update: Still not fixed in 2016

Update. Still not fixed in 2019 (@Edz)

edit retag flag offensive close delete

Comments

Did you find anything about it?

muppeth ( 2014-11-19 15:58:06 +0300 )edit

Any solutions for this?

olpe ( 2014-11-30 13:56:04 +0300 )edit

From what I dag out. There is no simple way to change that. Also after playing around with webview I have to say it isn't really usable when displaying gifs or many images. Also no support for html5 makes it, at least for my project unusable.

muppeth ( 2014-12-01 00:42:15 +0300 )edit

Still not fixed in Update 10 with Qt 5.2. If the default browser uses devicepixelratio 1.5 the webview should also use it or Jolla should patch webview so that we can freely set a devicepixelratio. (Ubuntu Touch does this for example)

leszek ( 2015-01-02 01:24:09 +0300 )edit
2

You could try a workaround. In my app ("Kaktus"), I was facing the same issue. The solution was to use WebView.experimantal.evaluateJavaScript() to dynamically change the webview param in the web page. You can do it like this:

webView.experimental.evaluateJavaScript(
        "(function(){
           var viewport = document.querySelector('meta[name=\"viewport\"]');
           if (viewport) {
             viewport.content = 'initial-scale=1.5';
           } else {
             document.getElementsByTagName('head')[0].appendChild('<meta name=\"viewport\" content=\"initial-scale=1.5\">');
           }
         })()",
         function(result) {
         });
mkiol ( 2016-04-08 13:35:18 +0300 )edit

1 Answer

Sort by » oldest newest most voted
14

answered 2015-01-03 22:20:02 +0300

leszek gravatar image

updated 2015-01-03 22:20:15 +0300

Opened an issue on mer-packages/qtwebkit5 with a small fix which should allow us to set the devicePixelRatio or deviceScaleFactor from QML.

https://github.com/mer-packages/qtwebkit5/issues/22

edit flag offensive delete publish link more

Comments

1

you should open MER BUG

coderus ( 2019-03-08 18:02:20 +0300 )edit

@coderus feel free to open a bug. I've given up already. After several promises I am not going to waste more time on this.

leszek ( 2019-03-09 19:12:47 +0300 )edit
Login/Signup to Answer

Question tools

Follow
6 followers

Stats

Asked: 2013-12-25 16:03:09 +0300

Seen: 995 times

Last updated: Mar 08 '19