[英]How to override a method in the script of a XUL in another add-on?
I would like to change the behavior/extend some of the functionality in another add-on. 我想更改行为/扩展另一个插件中的某些功能。 The answer in Is it possible to modify a firefox addon written using XUL with an addon written using the Addon SDK says “ 是否可以修改使用XUL编写的firefox插件和使用Addon SDK编写的插件 ”中的答案
There are certain ways to monkey-patch code in Javascript code modules, if you really have to... 如果您确实需要...,可以使用某些方法在Javascript代码模块中进行猴子修补代码。
but the code I want to modify is the js script for a xul overlay 但是我要修改的代码是xul覆盖的js脚本
Is it possible to override some functions in that script? 是否可以覆盖该脚本中的某些功能? And if so, how? 如果是这样,怎么办? It looks like overlaying the xul with my own to run code in its context would work, as suggested in Overriding/Overlaying a XUL method , but is there a way to do this with the add-on sdk? 就像在覆盖/覆盖XUL方法中所建议的那样,用我自己的xul覆盖代码以在上下文中运行代码似乎可以工作,但是有没有办法使用附加sdk做到这一点? (Jetpack) (Jetpack的)
Thanks. 谢谢。
This xul article shows how to override functions: https://developer.mozilla.org/en-US/Add-ons/Overlay_Extensions/XUL_School/Appendix_C:_Avoid_using_eval_in_Add-ons?redirectlocale=en-US&redirectslug=XUL_School%2FAppendix_C%3A_Avoid_using_eval_in_Add-ons 这篇xul文章展示了如何覆盖函数: https : //developer.mozilla.org/zh-CN/Add-ons/Overlay_Extensions/XUL_School/Appendix_C :_Avoid_using_eval_in_Add-ons?redirectlocale=en-US&redirectslug=XUL_School%2FAppendix_C%3A_Avoid_using
This topic here shows how to access code scope of addons: Controlling a Firefox Extension via Javascript 这里的主题显示如何访问插件的代码范围: 通过Javascript控制Firefox扩展
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.