Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WP7 WebBrowser control zoom

Some pages are too small and hard to read in WebBrowser control, is zooming possible?

like image 211
Janci Avatar asked Dec 21 '10 14:12

Janci


2 Answers

If you have control of the html you can set the initial-scale of the viewport. More background here.

The IE Mobile Viewport on Windows Phone 7

like image 60
Mick N Avatar answered Jan 01 '23 17:01

Mick N


I went with the following hack:

BrowserControl.LoadCompleted += Browser_dohack;
private void Browser_dohack(object sender, NavigationEventArgs e)
    {
        string html = BrowserControl.SaveToString();
        string hackstring = "<meta name=\"viewport\" content=\"width=320,user-scalable=yes\" />";
        html = html.Insert(html.IndexOf("<head>", 0) + 6, hackstring);
        BrowserControl.NavigateToString(html);
        BrowserControl.LoadCompleted -= Browser_dohack;
    }
like image 41
Esa Avatar answered Jan 01 '23 17:01

Esa