Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Open Browser, Wait for Callback

Open Browser, Wait for Callback

Scheduled Pinned Locked Moved C#
comjsonhelpquestion
10 Posts 4 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    Is it possible to open a browser with Process.Start("www.someplace.com") and wait for a callback? If so, what would that look like? I need to call Google People API in the default browser and wait for the redirect URL.

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    D P 2 Replies Last reply
    0
    • K Kevin Marois

      Is it possible to open a browser with Process.Start("www.someplace.com") and wait for a callback? If so, what would that look like? I need to call Google People API in the default browser and wait for the redirect URL.

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Callback? What callback? No. You're "fire and forget" launching a new process that runs independently from your code. There is no callback or notification of anything completing in the browser. You can call the Google API using an HttpClient and you'll have much greater control over the request and response process.

      Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
      Dave Kreskowiak

      K L 2 Replies Last reply
      0
      • D Dave Kreskowiak

        Callback? What callback? No. You're "fire and forget" launching a new process that runs independently from your code. There is no callback or notification of anything completing in the browser. You can call the Google API using an HttpClient and you'll have much greater control over the request and response process.

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
        Dave Kreskowiak

        K Offline
        K Offline
        Kevin Marois
        wrote on last edited by
        #3

        Ya, I was just hoping. Thanks anyhow

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          Callback? What callback? No. You're "fire and forget" launching a new process that runs independently from your code. There is no callback or notification of anything completing in the browser. You can call the Google API using an HttpClient and you'll have much greater control over the request and response process.

          Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
          Dave Kreskowiak

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          This? [Window: DOMContentLoaded event - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded\_event)

          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

          D 1 Reply Last reply
          0
          • L Lost User

            This? [Window: DOMContentLoaded event - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded\_event)

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            That fires inside the browser. It's not raised, or even exposed, to a separate process that launched the browser.

            Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
            Dave Kreskowiak

            L 1 Reply Last reply
            0
            • D Dave Kreskowiak

              That fires inside the browser. It's not raised, or even exposed, to a separate process that launched the browser.

              Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
              Dave Kreskowiak

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Does the web browser / view control qualify? [WebBrowser.DocumentCompleted Event (System.Windows.Forms) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowser.documentcompleted?view=windowsdesktop-7.0) [WebBrowser.LoadCompleted Event (System.Windows.Controls) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.webbrowser.loadcompleted?view=windowsdesktop-7.0) [WebView.DOMContentLoaded Event (Windows.UI.Xaml.Controls) - Windows UWP applications | Microsoft Learn](https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.webview.domcontentloaded?view=winrt-22621)

              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

              D 1 Reply Last reply
              0
              • L Lost User

                Does the web browser / view control qualify? [WebBrowser.DocumentCompleted Event (System.Windows.Forms) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowser.documentcompleted?view=windowsdesktop-7.0) [WebBrowser.LoadCompleted Event (System.Windows.Controls) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.webbrowser.loadcompleted?view=windowsdesktop-7.0) [WebView.DOMContentLoaded Event (Windows.UI.Xaml.Controls) - Windows UWP applications | Microsoft Learn](https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.webview.domcontentloaded?view=winrt-22621)

                "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                You'd have to use the WebView2 control or the WebBrowser in your own app to get at the event. For one launched though the Process class, not so much. He never said why he's launching it through Process or anything else related to it so until he does, suggestion after suggestion is a moot point.

                Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
                Dave Kreskowiak

                K 1 Reply Last reply
                0
                • K Kevin Marois

                  Is it possible to open a browser with Process.Start("www.someplace.com") and wait for a callback? If so, what would that look like? I need to call Google People API in the default browser and wait for the redirect URL.

                  If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  Rather than using a Web browser, you would be better interacting directly with the API. If you have to use the browser, you could always use a Web driver and Selenium. This should be of interest. How to automate web browser in C# - CODE-AI[^]

                  Advanced TypeScript Programming Projects

                  1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    You'd have to use the WebView2 control or the WebBrowser in your own app to get at the event. For one launched though the Process class, not so much. He never said why he's launching it through Process or anything else related to it so until he does, suggestion after suggestion is a moot point.

                    Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
                    Dave Kreskowiak

                    K Offline
                    K Offline
                    Kevin Marois
                    wrote on last edited by
                    #9

                    Sorry I didn't clarify... I need to call Google's People API from a WPF app and wait for authentication. Once authentication is complete, then my app will get contact info. The requirement from Google is that the app not use an embedded browser, so I have to figure out if the user authenticated before continuing.

                    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                    D 1 Reply Last reply
                    0
                    • K Kevin Marois

                      Sorry I didn't clarify... I need to call Google's People API from a WPF app and wait for authentication. Once authentication is complete, then my app will get contact info. The requirement from Google is that the app not use an embedded browser, so I have to figure out if the user authenticated before continuing.

                      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                      D Offline
                      D Offline
                      Dave Kreskowiak
                      wrote on last edited by
                      #10

                      OK, so does the Google API have an alternate way to authenticate using credentials the user enters in your app instead of using the Google login page?

                      Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
                      Dave Kreskowiak

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups