@kyanny's blog

日本をもう一度「洗濯」してやる - 坂本龍馬

crx_unpack gem released

I released crx_unpack gem.

This gem unpacks Google Chrome extension package (crx) and extracts contents of extension from packed zip archive.

require 'crx_unpack'

data = open('extension.crx', 'rb').read
crx = CrxUnpack.unpack(data)
crx.zip #=> zip data of extension contents

# unzip extension contents into `./extension' directory
CrxUnpack.unpack_contents_from_file('extension.crx', './extension')

CRX Package Format is simple, but if you are fed up with writing code to handle the binary data, it helps you.

Feel free to report any issue and patches welcome.