如果最初没有指定清单版本,是否需要将Chrome扩展程序更新为清单版本2? [英] Need to update Chrome extension to manifest version 2 if no manifest version originally specified?

查看:125
本文介绍了如果最初没有指定清单版本,是否需要将Chrome扩展程序更新为清单版本2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的扩展目前没有指定任何清单版本。它是否需要更新以显示版本2?



有点不清楚,基于这些页面(可能需要更新以清楚起见):



http://developer.chrome.com/extensions/manifestVersion .html 提到了从版本1到版本2的政策变化:

http://developer.chrome.com/extensions/contentSecurityPolicy.html



特别是这段文字摘录:

未定义manifest_version的软件包没有默认的内容安全策略,选择manifest_version 2的软件包的默认内容安全策略为:
script-src 'self'; object-src'self'
此策略通过两种方式限制扩展和应用程序来增加安全性......



来自Google的关于需求的电子邮件从清单版本1更新到2,但假设这可能是所有已发布到其商店的扩展程序开发人员的常规电子邮件。

我可以更新我的扩展,不幸的是,我使用内联javascript,并且修改新设计更改的代码会有点麻烦。由于我没有指定清单版本,所以如果不需要更新,我宁愿不更新。



在附注中,如果Google有一种方法可以确定当您更改清单版本时应用程序是否存在兼容性问题。我的应用程序不带代码更新,添加清单版本2并在Chrome中加载会安装正常,但由于内容安全策略,我无法加载/弹出,这是我通过阅读文档得出的。如果安装失败会更好,因为它不符合策略,更容易调试。

更改。
Mo manifest_version等于第1版。



引用:
没有准备好跳转到的扩展,应用程序和主题Chrome 18中的新清单版本可以明确指定版本1 或完全关闭



From:
< href =http://developer.chrome.com/extensions/manifest.html#manifest_version =nofollow> http://developer.chrome.com/extensions/manifest.html#manifest_version


My extension currently doesn't specify any manifest version. Does it need to be updated to manifest version 2?

It's a bit unclear, based on these pages (perhaps need to be updated for clarity):

http://developer.chrome.com/extensions/manifestVersion.html mentions policy change from version 1 to 2 about this:

http://developer.chrome.com/extensions/contentSecurityPolicy.html

particularly this excerpt of text:

"Packages that do not define a manifest_version have no default content security policy. Those that select manifest_version 2, have a default content security policy of: script-src 'self'; object-src 'self' This policy adds security by limiting extensions and applications in two ways..."

And I did get an email from Google about the need to update from manifest version 1 to 2, though assume that may have been a general email to all extension developers that have published to their store.

I could update my extension, unfortunately, I use inline javascript and it would be a bit of a hassle to modify the code for the new design change. Since I don't specify a manifest version to begin with, would rather not update if I didn't have to.

On a side note, would be nice if Google had a way to determine if app broke in compatibility when you change manifest versions. My app w/o code update, adding manifest version 2 and loading in Chrome would install fine but would fail to load/popup because of the content security policy, which I figured from reading the docs. Would have been better if it failed to install because it didn't meet policy, easier to debug that way.

解决方案

You should change it. Mo manifest_version equals to version 1.

Quote: "Extensions, applications, and themes that aren't ready to make the jump to the new manifest version in Chrome 18 can either explicitly specify version 1, or leave the key off entirely."

From: http://developer.chrome.com/extensions/manifest.html#manifest_version

这篇关于如果最初没有指定清单版本,是否需要将Chrome扩展程序更新为清单版本2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆