IWithNativeJavaScriptDialogs.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. using System;
  15. using System.Threading.Tasks;
  16. namespace Vuplex.WebView {
  17. /// <summary>
  18. /// An interface implemented by a webview if it supports showing native popups
  19. /// triggered by JavaScript dialog APIs like window.alert() and confirm().
  20. /// </summary>
  21. /// <example>
  22. /// <code>
  23. /// await webViewPrefab.WaitUntilInitialized;
  24. /// var webViewWithNativeDialogs = webViewPrefab.WebView as IWithNativeJavaScriptDialogs;
  25. /// if (webViewWithNativeDialogs == null) {
  26. /// Debug.Log("This 3D WebView plugin doesn't yet support IWithNativeJavaScriptDialogs: " + webViewPrefab.WebView.PluginType);
  27. /// return;
  28. /// }
  29. /// webViewWithNativeDialogs.SetNativeJavaScriptDialogsEnabled(false);
  30. /// </code>
  31. /// </example>
  32. public interface IWithNativeJavaScriptDialogs {
  33. /// <summary>
  34. /// Native JavaScript dialog popups are enabled by default but can be disabled using this method.
  35. /// </summary>
  36. void SetNativeJavaScriptDialogsEnabled(bool enabled);
  37. }
  38. }