GithubHelp home page GithubHelp logo

Comments (10)

iFarSeer avatar iFarSeer commented on July 21, 2024 6

这个项目的参考价值很值得推敲。
当我看到25%注入这段代码时,我便开始对质量有所怀疑。
这个方案只是博主的妥协方案,对webview的机制了解不够深入,经过简单的测试,测试通过称为验证方案可行性的依据。
从逻辑上已经本末倒置,故,项目的目前版本无参照价值。

其实让我心寒的是,此项目获得1000+的star,再次说明了github的star没有任何参考价值。

from safe-java-js-webview-bridge.

snowdream avatar snowdream commented on July 21, 2024

@pedant

from safe-java-js-webview-bridge.

AllinZzz avatar AllinZzz commented on July 21, 2024

我遇到了类似的问题,在控制台上,我分析了一下,基本上可以注入成功,不过就是注入的时机,有可能在25%,有可能在50%,有可能在100%.........只要是大于25%的,都有可能....现在问题就出现了,假设注入时机在47%,这时候注入成功了,但是前端在调用native方法的时候,在47%之前,就会报HostApp is undefined,这样的异常,并且,前端使用了document.ready 或者 window.onLoad 这两个时机再去调用native方法,还是有可能出现 HostApp is undefined 这样的异常....不知道这里面是否有什么需要注意的地方呢....真希望有遇到类似情况的哥们,给个解决思路

from safe-java-js-webview-bridge.

nketc avatar nketc commented on July 21, 2024

@iFarSeer , 请问你有其它关于注入时机的方案吗?

from safe-java-js-webview-bridge.

iFarSeer avatar iFarSeer commented on July 21, 2024

目前,我没有比较好的时机去完成注册,目前我已经淘汰这样方案。

from safe-java-js-webview-bridge.

nketc avatar nketc commented on July 21, 2024

可以说一下你现在的方案吗?在不改动webview内部实现的情况下. @iFarSeer

from safe-java-js-webview-bridge.

whiskeyfei avatar whiskeyfei commented on July 21, 2024

好好看代码才是硬道理

from safe-java-js-webview-bridge.

qbeenslee avatar qbeenslee commented on July 21, 2024

的确直接使用这个项目很不稳定, 但这个项目的实现JsBridge交互的方案可以借鉴.
注入时机为页面加载进度的25%, 是这个项目的败笔.

由于webview的native层实现不可靠(很明显说的是bugme), onProgressChanged方法是否被调用, 有没有25%以上的进度出现这些都是未知的.

总之, 交互方案可以借鉴, 核心bug很严重.

from safe-java-js-webview-bridge.

iFarSeer avatar iFarSeer commented on July 21, 2024

@nketc 之前我在AndroidJSSDKCore中也多次尝试各种方案,多种设备测试下来,结果都是不理想的。

from safe-java-js-webview-bridge.

zivxia avatar zivxia commented on July 21, 2024

这个现在有解决方案了吗,
image

from safe-java-js-webview-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.