Skip to content

Conversation

@stevenlele
Copy link
Contributor

Chromium 目前是扫描 Extensions 目录,导致结果有多版本重复、获取到的名称和描述是语言文件的 key、缺少自行加载的扩展等问题,因此改成直接读取 Secure Preferences(旧版本为 Preferences)文件,Profile 路径通过临时文件传递(最好是重构之后直接在程序内传递)。

Firefox 的 defaultLocale 一般是英文,因此添加了一个语言匹配的逻辑,目标语言放在 var lang = language.Und 全局变量处,不过没有添加命令行参数,可以之后添加,类似 --lang zh-CN,然后这样解析即可:

import "golang.org/x/text/language"

tag, _ := language.Parse(langStr)

err 可以忽略,因为可能已经解析出部分 tag,解析不出来也只是默认的 Und

@moonD4rk
Copy link
Owner

moonD4rk commented Aug 3, 2023

Good Job!

- Refactor extension parsing function for clarity and DRYness
- Update name of a file to "Secure Preferences"
- Add TODO comment for future work on extension files and folders
- Remove unnecessary file write operation and import statement
@moonD4rk moonD4rk merged commit c75b92f into moonD4rk:dev Jan 9, 2024
@stevenlele stevenlele deleted the extensions branch January 9, 2024 06:29
moonD4rk added a commit that referenced this pull request Jan 9, 2024
* feat: improve extension parsing

* refactor: Refactor extension parsing and update file names.

- Refactor extension parsing function for clarity and DRYness
- Update name of a file to "Secure Preferences"
- Add TODO comment for future work on extension files and folders
- Remove unnecessary file write operation and import statement

---------

Co-authored-by: moonD4rk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants