Electrolysis compatibility shims doesn't work with evalInSandbox

后端 未结 1 901
粉色の甜心
粉色の甜心 2021-01-24 02:11

We have a rather old XUL extension which we want to make sure works with Electrolysis. We will eventually migrate it to the WebExtensions API, but for now we want to use the com

1条回答
  •  伪装坚强ぢ
    2021-01-24 03:01

    Your sandboxPrototype is wrong, you are setting it to the nsIDOMWindow, set it to the aNSIDOMWindow.gBrowser.tabContainer.childNodes[tab_index_goes_here].contentWindow

    see this example on mdn: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.Sandbox#Example

    also here is how to load in a script as file rather then doing evalInSandbox:

    https://github.com/Noitidart/modtools

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