简体   繁体   中英

How to launch a reduced browser in c#?

I need to launch a browser to example: "http://www.abc.com" with c#.

The thing is, I don't want all those "Go Back", "add new tab", "search box", or "toolbar" appear on the launched browser, and I need a smaller browser, not maximized one.

How to achieve it in C#?

currently I am using System.Diagnostics.Process.Start(url);

Thanks.

From within a web page, you can use Javascript's window.open function to do this.

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

For your situation, you have two options, neither is perfect.

  1. Create a WinForms app with a WebBrowser control and only the controls you need and launch that. (Sort of a "dumbed down"browser)

  2. Actually launch a browser to a page you've set up. This page would have a javascript call to open a new window, and then close itself.

Option 2 is not likely to work, and more likely than not, your end users will ahve pop-ups disabled. Option 1 will work, giving you full control over the UI, and what buttons you want, but it's not launching the default browser, and it means you have to put the "dumbed down browser" app on your client's PC.

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