Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

当前端没有使用 dsbridge 框架时,调用 hasJavascriptMethod 无返回 #30

Open
ainiyiwan opened this issue Jan 14, 2025 · 3 comments

Comments

@ainiyiwan
Copy link

代码实例
`
async shareAction() {

let haveMethod: Boolean = await this.controller.getControllerProxy().hasJavascriptMethod('web_share')
if (haveMethod) {
  
} else {
 
}

}
`
会一直卡在 await 这里,无法向下执行
比如百度的 url:https://www.baidu.com/

@751496032
Copy link
Owner

代码实例 ` async shareAction() {

let haveMethod: Boolean = await this.controller.getControllerProxy().hasJavascriptMethod('web_share')
if (haveMethod) {
  
} else {
 
}

} ` 会一直卡在 await 这里,无法向下执行 比如百度的 url:https://www.baidu.com/

前端不使用dsbridge 是无法使用当前库的,是配套的

@ainiyiwan
Copy link
Author

代码实例 ` async shareAction() {

let haveMethod: Boolean = await this.controller.getControllerProxy().hasJavascriptMethod('web_share')
if (haveMethod) {
  
} else {
 
}

} ` 会一直卡在 await 这里,无法向下执行 比如百度的 url:https://www.baidu.com/

前端不使用dsbridge 是无法使用当前库的,是配套的

我的意思是,我上面那段代码是 Web 组件的通用代码,无论加载什么网页都会执行这段代码,但是当加载一个网页的时候,可能会遇到 hasJavascriptMethod 无返回的情况,这种时候逻辑就无法往下走了。
这种情况下,这个库能返回一个结果回来吗?

@751496032
Copy link
Owner

代码实例 ` async shareAction() {

let haveMethod: Boolean = await this.controller.getControllerProxy().hasJavascriptMethod('web_share')
if (haveMethod) {
  
} else {
 
}

} ` 会一直卡在 await 这里,无法向下执行 比如百度的 url:https://www.baidu.com/

前端不使用dsbridge 是无法使用当前库的,是配套的

我的意思是,我上面那段代码是 Web 组件的通用代码,无论加载什么网页都会执行这段代码,但是当加载一个网页的时候,可能会遇到 hasJavascriptMethod 无返回的情况,这种时候逻辑就无法往下走了。 这种情况下,这个库能返回一个结果回来吗?

ok 我测试下看看

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants