Google Chrome Extension

I have two files. manifest.json and content.js. I compressed both files in Zip format and convert to CRX format.

Then just drag and drop the .crx file into the Chrome Chrome browser and continue with the installation of the crx file. But it shows a warning like "CRX_MAGIC_NUMBER_INVALID".

How to solve this problem?

+4
source share
4 answers

To download extensions from the online store, you need to be logged in to your Google account. This is stupid, but this is the best way. A source

My friend had the same problem installing the homebrew extension. This should be the solution to your problem.

+4
source

Chrome has an option to expand the package . Go to manage the extension, and there you will see this option. They will make a .crx file for you.

+2
source

Otherwise, you can do this using a batch file

 cd /d C:\Documents and Settings\[username]\Local Settings\Application Data\Google\Chrome\Application chrome --pack-extension="[path of extensionfolder]" --no-message-box 
+2
source

This is a problem with the format of your CRX file. Code

http://src.chromium.org/svn/trunk/src/chrome/browser/extensions/sandboxed_extension_unpacker.cc

looks for a "magic number" at the beginning of the file, as described here

http://code.google.com/chrome/extensions/crx.html

It seems that (not always) you can zip the extension and rename it to crx. Perhaps something is related to the zip tool used? In any case, this topic discusses a very similar problem and solution.

http://groups.google.com/a/chromium.org/group/chromium-apps/browse_thread/thread/1785b46c2998af2c

0
source

Source: https://habr.com/ru/post/1346204/


All Articles