Skip to content

提几点建议 #5

Description

@wlwinston

AppHostViewController+Scripts中的kAppHostCustomJavscripts初始化是在+ (void)prepareJavaScript:(id)script when:(WKUserScriptInjectionTime)injectTime key:(NSString *)key方法初始化的,而这个方法只有在AHDebugResponse的setupDebugger的方法中才会被调用,并且调用的代码做了#ifdef AH_DEBUG 宏判断,如果生产环境去掉AH_DEBUG的话,kAppHostCustomJavscripts则不会初始化,那么注入apphost.js、eval.js的injectScriptsToUserContent方法 则不会其效果,jsapi就无法注入了。建议将kAppHostCustomJavscripts的初始化代码挪出来。
第二个问题,自带的HTMLParser兼容性不太好,在我的工程中使用时候,我的WEB工程是用vuejs,生成的index.html里的script以及link标签无法识别,导致无法进行src的替换和文件内联。建议更换成Gumbo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions