Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch a Google Chrome Tab with specific URL using C#

Is there a way I can launch a tab (not a new Window) in Google Chrome with a specific URL loaded into it from a custom app? My application is coded in C# (.NET 4 Full).

I'm performing some actions via SOAP from C# and once successfully completed, I want the user to be presented with the end results via the browser.

This whole setup is for our internal network and not for public consumption - hence, I can afford to target a specific browser only. I am targetting Chrome only, for various reasons.

like image 855
miCRoSCoPiC_eaRthLinG Avatar asked Sep 27 '22 05:09

miCRoSCoPiC_eaRthLinG


People also ask

What is the URL for a new chrome tab?

New Tab: The page that appears when the user creates a new tab or window. You can also get to this page by entering the URL chrome://newtab. Note: A single extension can override only one page.

What is the URL for chrome settings?

chrome://settings — Access Chrome Settings Simply type “chrome://settings” into the address bar and click Enter. In fact, you don't have to type it all. Simply type chrome into the address bar and your browser would display auto-complete suggestions.

How do I Start Chrome from a URL?

As a simplification to chrfin'sresponse, since Chrome should be on the run path if installed, you could just call: Process.Start("chrome.exe", "http://www.YourUrl.com"); This seem to work as expected for me, opening a new tab if Chrome is already open.

Can new tabs show the homepage url in chrome?

New Chrome versions open a tab with the Google page.without displaying a URL. I would like new tabs to show the homepage URL This was a feature of previous Chrome versions. Community content may not be verified or up-to-date.

How do I get chrome to open in command prompt?

Open Chrome Using Command Prompt. First, open the Command Prompt by typing “command” in the Windows 10 search bar and then selecting “Command Prompt” from the search results. In Command Prompt, run the following command: start chrome. Chrome will now open. You can also do the same thing from the “Run” window.

Which browser should I use to open a particular URL?

We want to open a particular URL in Google Chrome, but the default browser is Internet Explorer. Most company apps either support or require Internet Explorer, so we don’t want to change the default browser – but one app works better in Chrome.


1 Answers

As a simplification to chrfin's response, since Chrome should be on the run path if installed, you could just call:

Process.Start("chrome.exe", "http://www.YourUrl.com");

This seem to work as expected for me, opening a new tab if Chrome is already open.

like image 68
Dylan Watson Avatar answered Oct 22 '22 23:10

Dylan Watson