UniWebViewChannelMethodHandleRequest.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // UniWebViewChannelMethodHandleRequest.cs
  3. // Created by Wang Wei(@onevcat) on 2023-04-21.
  4. //
  5. // This file is a part of UniWebView Project (https://uniwebview.com)
  6. // By purchasing the asset, you are allowed to use this code in as many as projects
  7. // you want, only if you publish the final products under the name of the same account
  8. // used for the purchase.
  9. //
  10. // This asset and all corresponding files (such as source code) are provided on an
  11. // “as is” basis, without warranty of any kind, express of implied, including but not
  12. // limited to the warranties of merchantability, fitness for a particular purpose, and
  13. // noninfringement. In no event shall the authors or copyright holders be liable for any
  14. // claim, damages or other liability, whether in action of contract, tort or otherwise,
  15. // arising from, out of or in connection with the software or the use of other dealing in the software.
  16. //
  17. using System;
  18. using UnityEngine;
  19. /// <summary>
  20. /// Represents the request of a loading used in request handler.
  21. /// </summary>
  22. [Serializable]
  23. public class UniWebViewChannelMethodHandleRequest {
  24. [SerializeField]
  25. private string url;
  26. [SerializeField]
  27. private bool isMainFrame = true;
  28. /// <summary>
  29. /// The URL of the request.
  30. /// </summary>
  31. public string Url => url;
  32. /// <summary>
  33. /// Whether the request is for the main frame (top-level document) or an embedded frame (iframe).
  34. ///
  35. /// Returns true for main frame requests, false for iframe requests.
  36. ///
  37. /// Note: On older Android versions (API level < 24), this may always return true due to
  38. /// platform limitations in distinguishing between main frame and iframe requests.
  39. /// </summary>
  40. public bool IsMainFrame => isMainFrame;
  41. }