PopupMode.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Copyright (c) 2021 Vuplex Inc. All rights reserved.
  3. *
  4. * Licensed under the Vuplex Commercial Software Library License, you may
  5. * not use this file except in compliance with the License. You may obtain
  6. * a copy of the License at
  7. *
  8. * https://vuplex.com/commercial-library-license
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. namespace Vuplex.WebView {
  17. /// <summary>
  18. /// Options for how a webview that implements `IWithPopups` handles popups.
  19. /// </summary>
  20. public enum PopupMode {
  21. /// <summary>
  22. /// The popup URL is automatically loaded into the original webview.
  23. /// This is the default behavior. In this mode, the `PopupRequested` event isn't raised.
  24. /// </summary>
  25. LoadInOriginalWebView = 0,
  26. /// <summary>
  27. /// The browser engine automatically creates a new webview for the popup
  28. /// and loads the popup URL into the new webview. The original webview then
  29. /// raises its `PopupRequested` event and provides the new popup webview as `PopupRequestedEventArgs.WebView`.
  30. /// </summary>
  31. /// <remarks>
  32. /// Some authentication flows require this mode in order to function correctly. For example,
  33. /// auth flows like "Sign in with Google" open the signin page in a special popup
  34. /// that can relay the auth result back to the original page after authorization is finished.
  35. /// `LoadInNewWebView` must be used for flows like this, and the flow can not be emulated with
  36. /// the other popup modes.
  37. /// </remarks>
  38. LoadInNewWebView = 1,
  39. /// <summary>
  40. /// The browser engine doesn't automatically create a new webview for the popup,
  41. /// but it still raises the `PopupRequested` event with a `PopupRequestedEventArgs.WebView` of `null`.
  42. /// </summary>
  43. NotifyWithoutLoading = 2
  44. }
  45. }