PopupMode.cs 2.1 KB

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