Cannot load extension with file or directory name _metadata - google-chrome-extension

I get the .crx file of an extension name simulty in order to edit the source ( for personal use )
So i have follow all the steps :
get .crx
unzip .crx
Load in Google chrome extension
But when i try to load i have the same error " Cannot load extension with file or directory name _metadata "
There is a _metadata and a locales files in the directy and it seems that google chrome don't want to load it. Is there any way to take off the "" ... and load it ? I heard that its a google chrome bug...
Anybody find the solution ?
Or know any other way to edit the source of an chrome extension?

You can just delete the _metadata folder when loading an unpacked extension.
It contains cryptographic hashes of files to ensure they have not been modified. It is not expected to be present for an unpacked extension (it's automatically added by CWS when generating a crx), so just delete it.
I would also suggest editing the manifest to wipe update_url and key fields (if present), to completely dissociate with the original extension.

Related

Is there a way to copy an extension from a browser to another?

Is there a way to copy an extension from a browser to another browser (both chromium based)?
In windows 10 I know the browser reads its data from this folder:
C:\Users<account_name\AppData\Local<browser>\User Data\Default
in Default there are several folders, among many:
"Extensions" and "Local Extension Settings"
which have as many folders inside as there are extensions installed and each of these folders has the extension id as its name.
So I tried copying Extensions\<id_ext> and "Local Extension Settings"\<id_ext> to their respective folders of another browser, but that wasn't enough.
Do I forget something (some other folder and\or registry key) or i's not possible to do this operation (without breaking the browser of course)?
EDIT
my goal is to have an old version of an extension fully installed in the browser (make the browser believe that it comes from the CWS) but in which I have disabled future updates (by modifying the update_url field in the manifest.json file with a fictitious address)
EDIT # 2
I will try to add two lines to better explain my purposes.
I've read something on SO and beyond, but nothing that can enlighten me about it.
My aim is to install an old version of an extension created by me
(I have the extension public key but I no longer have the private key), to block the update for a certain time and then update when I want by resetting the update_url field in the manifest.
Thanks

Can manifest.json have both 2 and 3 versions?

It seems that Chrome Store refuses to accept manifest 2, and FireFox does not understand manifest 3. That is, I can no longer create one extension ZIP file and upload to both Chrome Store and FireFox Store.
Is there a way to have both 2 and 3 versions in one manifest.json file at the same time?
No, a manifest file can only have one version defined.
If your extension works in both manifest versions, what you can do is have two manifest.json files (like manifest_v2.json and manifest_v3.json and then create two zip files, one using version 2 manifest for Firefox and one using version 3 manifest for Chrome. You do need to rename them to manifest.json before creating the zip though.
If you build manually, it's a bit of manual work to rename a file, create zip, rename it back, rename the other file and repeat. If you have some build tools included, you can automate that process.

How to Selenium Load Chrome Extensions in a Specific Location

I am having an issue with Selenium (chrome+python 3.9) when loading extensions. I have set the user-data-dir to a specific location, but additionally loaded extensions from CRX are still loaded into to the localappdata.
Is there a way to force the extensions to load into another directory that isn't the randomly generated name in the appdata folder?

What is "platforms" for in manifest.json?

In manifest.json definition, there is a "platforms" key.
However, I cannot find it documented anywhere. What does it do?
The platforms key in the manifest file is part of a feature called multi-platform zip files, which is only relevant for NaCl. Developers can reduce the size of the crx file by putting platform-specific files in the _platform_specific directory and listing the directories in the platforms key in manifest.json. Users who then install the CRX from the Chrome Web Store will then only get the files specific for their platform.
This feature is documented at https://developer.chrome.com/native-client/devguide/distributing#distributing-packaged.

Is there a way to use a downloaded (xml-esque) file in an extension?

I'm attempting to write an emusic download manager extension for Chrome. This would essentially involve parsing the .emx file (xml-esque) downloaded from the site to get the temporary music file URL.
I've gone through everything I can find online about extensions working with downloads, but the problem comes in that the .emx file isn't directly accessible from the web. The link to download it seems to pass through a counter for your account so that it can deduct the cost, and then it pushes a file 0.emx to be downloaded. It doesn't seem to work with any hotlinking, even copying and pasting the button's destination URL into the same browser tab.
I think the only way to get the file is to wait for the 0.emx file to be pushed. Is there any way I can use an extension to intercept that file before it goes to the downloads folder or use it after it's already downloaded?
Thanks!

Resources