Solving “This extension may have been corrupted” in Chrome version 59



I found our extensions being detected as corrupted in the Chrome stable release version 59. After some research, I found a related bug report.

Basically, if the extension contains files with file size with is the multiple of 4096, the extension will be marked as corrupted.

Printing all files’ name and size

This following python code will print all the files’ name and size:

# Bug report:
# Description:
import os
import glob
size_dir = {}
for filename in glob.iglob('./**/*.*', recursive=True):
size =os.path.getsize(filename)
if size % 4096 == 0 and size != 0:
size_dir[filename] = os.path.getsize(filename)
for name, size in size_dir.items():
print(name, size)

view raw

hosted with ❤ by GitHub

The following result showing there is a file having 8192 bytes.



By just adding a lot of comments, I solve the issue:



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s