简体   繁体   中英

How to make Google authentication page fit in my webbrowser control?

Windows.Forms.Webbrowser to display the google authentication screen. The Webbrowser control is in a window of size 450x480 pxl and it fill the whole window. I am calling:

String UrlString = String.Format(
              @"https://accounts.google.com/o/oauth2/auth?"+
              @"display=popup" +
              @"&scope=email profile" +
              @"&redirect_uri=urn:ietf:wg:oauth:2.0:oob:auto" +
              @"&response_type=code"+
              @"&client_id=xxxx
            );
_webBrowser.Navigate(UrlString);

The page I get is too big for the Webbrowser control so it places Horizontal and vertical scrollbers. When I use the 'display=popup' in the facebook authentication page it renders without scrollbars. Is it possible to get Google authentication page fit in my webbrowser control?

On document load complete event you can invoke an eval javascript code that returns the height and width of the page. From here you set the width and height of the control based on this values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM