How can MetaMask extension pass the upload verification while its background.js is larger than 4M?

File is too large to parse.

Error: This file is not binary and is too large to parse. Files larger than 4MB will not be parsed. Consider moving large lists of data out of JavaScript files and into JSON files, or splitting very large files into smaller ones.

/metamask-9.5.4-an+fx $ll background.js
-rwxr-xr-x@ 1 staff staff 4089197 Nov 30 1979 background.js

Hi @wk3368, I’m not sure I understand your question. AMO won’t accept files that are larger than 4MB. You can minify the code to reduce the size of the file as long as you follow our policies around submissions with minified code.

To expand on that, you can also split JS files by either loading them one after another in the same context (for example with the scripts array for background) or using ES modules.

@caitlin,
I had unzipped the metamask-9.5.4-an+fx.zip and found that background.js size is 4089197 bytes, so I thought it is greater than 4MB = 4 * 1000 * 1000 = 4000000,
4089197 > 4000000.

but actually 4MB is 4 * 1024 * 1024 = 4194304, 4089197 < 4194304. so it is not a problem.

@freaktechnik, thanks for your tips.