| Crates.io | uncrx-rs |
| lib.rs | uncrx-rs |
| version | 0.2.2 |
| created_at | 2024-01-14 09:28:44.796966+00 |
| updated_at | 2024-01-27 11:46:29.581901+00 |
| description | Uncrx is a library that helps you convert a CRX Extension to a zip file that can be easily extracted. |
| homepage | |
| repository | https://github.com/iltumio/uncrx-rs |
| max_upload_size | |
| id | 1099312 |
| size | 34,377 |
Uncrx is a library that helps you convert a CRX Extension to a zip file that can be easily extracted.
cargo add uncrx-rs
// Open the CRX extension
let current_dir = env::current_dir().expect("Failed to get current directory");
let file_path = current_dir.join("src/mock/test-extension.crx");
let data = fs::read(file_path.to_str().unwrap()).expect("Failed to read file");
// Parse the extension
let extension = parse_crx(&data).expect("Failed to parse crx");
// Eventually save the zip section into a separate file for later extraction
let output_file = current_dir.join("out/extension.zip");
fs::write(output_file, &extension.zip).expect("Failed to write file");
Feel free to open issues and send PRs. We will evaluate them together in the comment section.
This project is licensed under the MIT License.