简体   繁体   English

使用JavaScript在XML文件中进行更改

[英]Make changes in XML file with javascript

I'm making a safari extension and i need to make a change in the info.plist file from javascript. 我正在进行一个野生动物园扩展程序,我需要从javascript中更改info.plist文件。

My javascript file is at /scripts 我的JavaScript文件位于/ scripts

So when a setting with a checkbox is changed the javascript puts the true/false value of that setting into the info.plist 因此,当更改带有复选框的设置时,javascript会将该设置的true / false值放入info.plist

How do i change a plist file (xml formatted) with javascript? 如何使用JavaScript更改plist文件(xml格式)?

I'd rather not be the bearer of bad news, but it's not possible for a Safari extension to programmatically change its own (much less any other) info.plist file. 我宁愿不是坏消息的承担者,但是Safari扩展程序不可能以编程方式更改其自己的(几乎没有其他任何信息)info.plist文件。 At least, there is no documented API method for doing so. 至少,没有记录的API方法可以这样做。

If you want to store a setting, using the safari.extension.settings object (or .secureSettings object) is the conventional way to do it—but that's probably not what you had in mind. 如果要存储设置,则使用safari.extension.settings对象(或.secureSettings对象)是执行此操作的常规方法-但这可能不是您想要的。

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

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