Need to update Chrome extension to manifest version 2 if no manifest version originally specified?

五迷三道 提交于 2019-12-11 04:49:19

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/12418979/need-to-update-chrome-extension-to-manifest-version-2-if-no-manifest-version-ori

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!