Google-chrome – disable Chrome’s Extension Content Verification

google-chromegoogle-chrome-extensions

Since a short while, google chrome extensions are 'content verified', meaning other apps can't 'hack' them. Sort of a good thing, but incredibly annoying, because I hack them all the time, to tweak and improve.

Almost immediately after saving an extension file, the extension is disabled and a message shows on the local extensions page:

This extension may have been corrupted

Is there a way I can disable this 'security' feature and keep hacking? I'd like to be the boss of my browser, not the other way around.

There is a chrome flag (extension-content-verification), but as the description says:

This can be used to turn on this feature if it would not otherwise have been turned on, but cannot be used to turn it off (because this setting can be tampered with by malware).

Best Answer

There is a fourth way to manage this problem and avoid the detection system entirely. Since you mention you want to hack your extensions, this implies you have some knowledge of extension development. It is also to be understood that extensions are, by their very nature, source code. This means that you have the entire source to fiddle with. That being said...

The fourth method is relatively simple as follows:

  1. Find the extension in the Extensions folder under Chrome's Application Data
  2. Copy that entire Extension's folder and paste it somewhere else
  3. Disable the original extension in Chrome
  4. Rename the newly copied abcsoupname extension folder to MyNewExtension
  5. Change to MyNewExtension folder
  6. Delete _metadata
  7. Edit manifest.json and remove key and update_url sections. Change the name and short_name sections to avoid any confusion with the other disabled extension.
  8. Validate and correct your manifest.json at jsonlint.com
  9. Go to the Settings=>Extensions
  10. Enable Developer Mode and then 'Load Unpacked Extension' on the new folder you just created.
  11. Voila. A new version of this extension not under Content Control.

You can now edit, manipulate and manage this extension as you desire. You'll need to click Reload from the extensions area whenever you make a change. Also, you won't receive updates from the original developer. So, you'll need to update periodically and figure out a way to merge updated changes into your separate extension code. You may be able to leave the update_url intact, but it will likely wipe out any changes you make on the next update. This is why I suggest removing it. Though, feel free to experiment.

By leaving the original extension disabled, this will allow you to enable it and periodically receive updates for the author's version. You can then compare the differences between your custom version and the author's version and merge in any necessary changes. I highly recommend this update approach to your new custom extension. If you choose to leave the update_url active, it will likely wipe out your changes on the next update (assuming this even works correctly on a modified extension). Since some extensions don't update very often, this could leave you scrambling to determine what you changed months later when the next update is released.

You will also need to perform these steps on any extension where you want to modify it. Effectively, you're creating a brand new extension using an existing extension's code base and then putting this extension in developer mode.

Note, don't use Mac's TextEdit to edit json files or it will replace " with “ or ” and fail the json syntax check.

Related Question