Commit 70f48c0a authored by abarth@chromium.org's avatar abarth@chromium.org

Add an escape hatch for loading legacy manifests

This patch adds a --allow-legacy-extension-manifests command line switch that
lets folks load extenions with old manifest_verions even if they would
otherwise be forbidden.

This escape hatch will help ease the transition to modern manifests, both for
us and for extension developers.  (We plan to use this switch internally to
avoid converting some test data to modern manifests.)

BUG=62897
Review URL: http://codereview.chromium.org/8776059

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112786 0039d316-1c4b-4281-b951-d872f2087c98
parent a0cbe31d
......@@ -564,6 +564,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kAllowHTTPBackgroundPage,
switches::kAllowLegacyExtensionManifests,
switches::kAllowScriptingGallery,
switches::kAppsCheckoutURL,
switches::kAppsGalleryURL,
......
......@@ -29,6 +29,11 @@ const char kAllowFileAccess[] = "allow-file-access";
// Allows non-https URL for background_page for hosted apps.
const char kAllowHTTPBackgroundPage[] = "allow-http-background-page";
// Allows the browser to load extensions that lack a modern manifest when that
// would otherwise be forbidden.
const char kAllowLegacyExtensionManifests[]
= "allow-legacy-extension-manifests";
// Don't block outdated plugins.
const char kAllowOutdatedPlugins[] = "allow-outdated-plugins";
......
......@@ -26,6 +26,7 @@ namespace switches {
extern const char kAllowCrossOriginAuthPrompt[];
extern const char kAllowFileAccess[];
extern const char kAllowHTTPBackgroundPage[];
extern const char kAllowLegacyExtensionManifests[];
extern const char kAllowOutdatedPlugins[];
extern const char kAllowRunningInsecureContent[];
extern const char kAllowScriptingGallery[];
......
......@@ -1413,7 +1413,9 @@ bool Extension::InitFromValue(extensions::Manifest* manifest, int flags,
}
if (flags & REQUIRE_MODERN_MANIFEST_VERSION &&
manifest_version() < kModernManifestVersion) {
manifest_version() < kModernManifestVersion &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowLegacyExtensionManifests)) {
*error = errors::kInvalidManifestVersion;
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment