HTMLViewer and mobile websites

Hi,

when I put an HTMLViewer on my window and load a page, the HTMLViewer get horizontal scrollbars that I can scroll to see the complete homepage.

But in my case I wish the that there are no horizontal scrollbars and the homepage fits to the width of my HTMLViewer to receive the mobile view of a website.

Is this possible?

[quote=253897:@Philipp von der Born]Hi,

when I put an HTMLViewer on my window and load a page, the HTMLViewer get horizontal scrollbars that I can scroll to see the complete homepage.

But in my case I wish the that there are no horizontal scrollbars and the homepage fits to the width of my HTMLViewer to receive the mobile view of a website.

Is this possible?[/quote]

Setting UserAgent to Safari Mobile should do the trick.
http://documentation.xojo.com/index.php/HTMLViewer.UserAgent
http://www.useragentstring.com/pages/Safari/

Hi,

thats not a secure solution, if the design of a webseite depending on the browser width. Most of the web sites have a design depending on the width and therefore defining an individual useragent does not helps :frowning:

[quote=253959:@Philipp von der Born]Hi,

thats not a secure solution, if the design of a webseite depending on the browser width. Most of the web sites have a design depending on the width and therefore defining an individual useragent does not helps :([/quote]
Have you tried Michel’s solution? What website are we talking about specifically?
If the scrollbars have appeared the website is not a responsive design.

[quote=253959:@Philipp von der Born]Hi,

thats not a secure solution, if the design of a webseite depending on the browser width. Most of the web sites have a design depending on the width and therefore defining an individual useragent does not helps :([/quote]

What do you mean “secure” ?

Do you or do you not want to display the site as on a mobile device ? The answer to your post is YES, it is possible, under the condition you do what is needed to emulate a mobile device.

The FIRST thing you want to do is to have an HTMLViewer the size of an iPhone (or Samsung, whatever). In practice, 320 x 480, 640 x 960, pick your choice at the link below. Then to make sure the web site recognizes your program as a mobile device you MUST set the user-agent.

http://iphoneresolution.com/

Now, if the display is still not right, refer to Tim Parnell’s reply above. And try displaying the site on your phone first.

You have a very superficial knowledge about what Responsive Design is. Before displaying for a mobile device, most sites do check for the user-agent header. There are hundreds of different phone sizes, and so using that only would be foolish.

http://smartphones.specout.com/saved_search/Smartphones-by-Screen-Size (4980 phones listed)

[quote=253959:@Philipp von der Born]Hi,

thats not a secure solution, if the design of a webseite depending on the browser width. Most of the web sites have a design depending on the width and therefore defining an individual useragent does not helps :([/quote]

Google though it was useful :stuck_out_tongue:
http://www.thesempost.com/googlebots-smartphone-user-agent-getting-a-new-name/

Hi,

I will try again setting the needed width and then using the right useragent. thanks alot.

My understanding for sites that are for example working with twitter bootstrap, they will not asking the useragent but working with different viewports for different resolutions. For example when I resize my chrome browser i will get different layouts depending on the width, because the site is responsive. That is what I like to get with htmlviewer.

Using Bootstrap doesn’t necessarily make a website responsive automatically, but that’s an entirely different discussion.

The phenomena you’re referring to is responsive design. If a website is designed to be responsive (ie, use viewport style changes rather than redirect based on user-agent) the scrollbars will not appear. If the scrollbars do appear the website is not a responsive design.

Need to test? Two of my websites are set up with responsive design.
Test your HTML Viewer on http://timi.me and https://webstudio.ws
The scrollbars should not appear for any viewport larger than 320px wide.

If you were to tell us the website you’re attempting to get working, we can confirm the best way to display the site.