简体   繁体   English

如何使Google身份验证页面适合我的Web浏览器控件?

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

Windows.Forms.Webbrowser to display the google authentication screen. Windows.Forms.Webbrowser以显示Google身份验证屏幕。 The Webbrowser control is in a window of size 450x480 pxl and it fill the whole window. Webbrowser控件在尺寸为450x480 pxl的窗口中,并且它会填充整个窗口。 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. 对于Webbrowser控件,我得到的页面太大,因此它放置了水平和垂直滚动条。 When I use the 'display=popup' in the facebook authentication page it renders without scrollbars. 当我在Facebook身份验证页面中使用“ display = popup”时,它呈现为无滚动条。 Is it possible to get Google authentication page fit in my webbrowser control? 是否可以让Google身份验证页面适合我的Web浏览器控件?

On document load complete event you can invoke an eval javascript code that returns the height and width of the page. 在文档加载完成事件中,您可以调用一个eval javascript代码,该代码返回页面的高度和宽度。 From here you set the width and height of the control based on this values. 在此,您可以根据此值设置控件的宽度和高度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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