How to replace a javascript file request with contents from another file in a FF addon?

后端 未结 1 415
我寻月下人不归
我寻月下人不归 2021-02-11 00:19

I\'m looking for some guidance on how to replace requests for a specific javascript file with another file that I\'ll package with the Firefox addon.

相关标签:
1条回答
  • 2021-02-11 01:01

    See How can I implement a content converter in Firefox for all page elements? (its scope is much wider than what you really need -- read on) on how to use registerFactory to register a surrogate HTTP protocol handler, which can then instantiate channels with alternate (e.g. file:///...-type) URIs when newChannel is called with your particualr script's URI.

    0 讨论(0)
提交回复
热议问题