简体   繁体   English

XPI需要哪些文件权限?

[英]What file permissions are needed in an XPI?

I recently received the following comment from the reviewer of one of my add-ons at the official Mozilla Add-ons website: 我最近在Mozilla附加组件官方网站上收到了我的一个附加组件的审阅者的以下评论:

The permissions in your XPI are broken. XPI中的权限已损坏。 Most files and directories do not have the expected read and execute permissions, or indeed any permissions at all. 大多数文件和目录没有预期的读取和执行权限,或者根本没有任何权限。

I wasn't aware that file permissions were an issue in XPI files. 我不知道文件权限是XPI文件中的问题。 To my knowledge, none of the files in my XPI need the execute bit set (I only package standard stuff: XUL, JavaScript, CSS, etc). 据我所知,我XPI中的所有文件都不需要执行位集(我只打包标准内容:XUL,JavaScript,CSS等)。 I create my XPI in Windows using the Cygwin zip tool, and since Windows knows nothing about file permissions, they aren't stored as they would be in Linux. 我使用Cygwin zip工具在Windows中创建XPI,并且由于Windows对文件权限一无所知,因此不会像在Linux中那样存储它们。

What file permissions are expected for file and directory entries in an XPI? XPI中的文件和目录条目需要什么文件许可? The Extension Packaging page at MDN has the following quote, but no associated details on what they should be: 扩展打包在MDN页面具有以下报价,但他们应该是没有什么关联的详细信息:

... you must verify that the file system permissions for the directories and files for the extension are set properly. ...您必须验证扩展目录和文件的文件系统权限设置正确。 Otherwise, the Extension Manager may not function properly with the extension or the extension itself may not work properly. 否则,扩展管理器可能无法与扩展正常运行,或者扩展本身可能无法正常工作。

This is typically an issue if you create the extension package on Windows but the extension is used on Linux or OS X later - Windows doesn't have any file permissions to be put into a ZIP archive and unpacking on Linux or OS X sometimes creates bogus file permissions ( 000 rather than the usual 755 or 644 ). 如果您在Windows上创建扩展程序包,但以后在Linux或OS X上使用该扩展程序,则通常会出现此问题-Windows没有任何文件权限可放入ZIP存档中,而在Linux或OS X上解压缩有时会导致虚假文件权限( 000而不是通常的755644 )。 You could try using a different ZIP packer, eg Info-ZIP that doesn't cause such issues for me. 您可以尝试使用其他ZIP压缩程序,例如Info-ZIP ,它不会对我造成此类问题。 Better yet, don't require your extension to be unpacked at all - <em:unpack> is often used but rarely really required. 更好的是,根本不需要解压缩扩展程序-经常使用<em:unpack>但很少真正需要它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM