I want to upgrade all my extensions to version 2 but still remain backward compatible for people that still have an older versions of chrome installed.
Since multiple manifest versions are currently unsupported, I would like to know which is the lowest version of Chrome that will support "manifest_version": 2
and its properties.
Manifest v2 was introduced in Chrome 18. Using Manifest version 2 adds several requirements to a extension, the most significant being:
<script>
tags in extension's context, and which disallowes execution of JavaScript code which are created via a string: Inline event listeners, inline scripts,eval
, etc.A consequence of broken features are JSONP and eval-based templating engines. These can be solved by using ordinary cross-site AJAX respectively the sandbox Chrome 21+.
web_accessible_resources
field is initiated at an empty list and hence all resources are blacklisted by default."background_page"
manifest entry becomes unavailable (superseded by"background"
+"scripts"
or"page"
).Manifest 2 also allows some APIs to be used, for example the
chrome.storage
API. When manifest v2 is left out, this message will appear below your extension.Except for the last remark, all of these requirements result in a stricter coding guideline for Chrome extensions (compared to manifest v1).
"background": {"scripts": ["..."]}
(and"page"
) is backwards-incompatible with Chrome 17 and lower, because it's introduced in Chrome 18. Use"background_page": "background.html"
instead.One extension for all Chrome versions can only be used if you're not using a background page. In other cases, such a hybrid (manifest v1+v2 compatible) extension cannot be achieved.
If you intend to distribute two different extensions, set
"minimum_chrome_version": "18"
in your manifest file. Don't forget to mention the location of the extension for older browsers.