Chrome extension - Can I share my extension as crx file for using someone?

旧街凉风 提交于 2021-01-28 11:01:45

问题


I publish my extension in google web store and install it successfully in my chrome.

So I find extension's files in this directory:

C:\Users\User_Name\AppData\Local\Google\Chrome\User Data\Default\Extensions.

I use my extension for native messaging in chrome.

How do I get .crx file for publish my extension for other people without internet connections?

Or exactly like firefox *.xpi files.

Also:

If I pack extension's files in above DIR to zip and rename to crx file, and drop down to chrome this error occurs:

Package is invalid: CRX_HEADER_INVALID.


回答1:


Packaging

Extensions and themes are served as .crx files. When uploading through the Chrome Developer Dashboard , the dashboard creates the .crx file automatically. If published on a personal server, the .crx file will need to be created locally or downloaded from the Chrome Web Store.

Download .crx from the Chrome Web Store

If an extension is hosted on the Chrome Web Store, the .crx file can be downloaded from the Developer Dashboard. Locate the extension under "Your Listings" and click on "More info". In the popup window, click the blue main.crx link to download it.

The downloaded file can be hosted on a personal server. This is the most secure way to host an extension locally as the contents of the extension will be signed by the Chrome Web Store. This helps detect potential attacks and tampering.

Create .crx locally

Extension directories are converted to .crx files at the Extensions Management Page. Navigate to chrome://extensions/ in the ominibox, or click on the Chrome menu, hover over "More Tools" then select "Extensions".

On the Extensions Management Page, enable Developer Mode by clicking the toggle switch next to Developer mode. Then select the PACK EXTENSION button.

Specify the path to the extension’s folder in the Extension root directory field then click the PACK EXTENSION button. Ignore the Private key field for a first-time package.

Chrome will create two files, a .crx file and a .pem file, which contains the extension’s private key.

Do not lose the private key! Keep the .pem file in a secret and secure place; it will be needed to update the extension.

Learn More



来源:https://stackoverflow.com/questions/52740280/chrome-extension-can-i-share-my-extension-as-crx-file-for-using-someone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!