HarmonyOS ArkWeb的WebviewController类的getLastJavascriptProxyCallingFrameUrl接口与getUrl接口的差异是什么,getUrl是否为不安全函数

HarmonyOS
2024-12-17 14:28:51
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
aquaa
/**
 * Get the url of the last frame that calls the JavaScriptProxy.
 * This should be called on the UI thread.
 *
 * @returns { string } The url of the last frame that calls the JavaScriptProxy.
 * @throws { BusinessError } 17100001 - Init error.
 *                           The WebviewController must be associated with a Web component.
 * @syscap SystemCapability.Web.Webview.Core
 * @atomicservice
 * @since 12
 */
getLastJavascriptProxyCallingFrameUrl(): string;


/**
 * Gets the url of current Web page.
 * @returns { string } Return the url of the current page.
 * @throws { BusinessError } 17100001 - Init error.
 *                           The WebviewController must be associated with a Web component.
 * @syscap SystemCapability.Web.Webview.Core
 * @crossplatform
 * @atomicservice
 * @since 11
 */
getUrl(): string;
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.

有以下区别,

  1. getUrl接口:getUrl接口用于获取当前Webview的URL。它主要用于获取当前Webview的加载状态和显示内容的URL。
  2. getLastJavascriptProxyCallingFrameUrl接口:getLastJavascriptProxyCallingFrameUrl接口用于获取调用JavaScriptProxy的URL。它主要用于获取最后一次调用注入的对象的frame的url。

getUrl是否为不安全函数getUrl接口本身并不是不安全的函数,这需要根据具体的使用场景来判断。

分享
微博
QQ
微信
回复
2024-12-17 15:46:53
相关问题
HarmonyOS on('imeShow')替代接口是什么
541浏览 • 1回复 待解决
HarmonyOS .ets和.ts文件差异是什么
919浏览 • 1回复 待解决
判断是否实现了某接口
1085浏览 • 1回复 待解决
是否有线程安全容器
2592浏览 • 1回复 待解决