feat: improve extension parsing #235
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Chromium 目前是扫描 Extensions 目录,导致结果有多版本重复、获取到的名称和描述是语言文件的 key、缺少自行加载的扩展等问题,因此改成直接读取 Secure Preferences(旧版本为 Preferences)文件,Profile 路径通过临时文件传递(最好是重构之后直接在程序内传递)。
Firefox 的 defaultLocale 一般是英文,因此添加了一个语言匹配的逻辑,目标语言放在
var lang = language.Und全局变量处,不过没有添加命令行参数,可以之后添加,类似--lang zh-CN,然后这样解析即可:err可以忽略,因为可能已经解析出部分tag,解析不出来也只是默认的Und。