Firefox 扩展,Xray Vision

问题描述 投票:0回答:1

我正在编写一个 Firefox 扩展。它应该拦截对

eval
innerHTML
等函数的调用。

目前,我无法执行此操作,因为 Firefox 会阻止覆盖这些属性。尽管甚至使用 XPCNativeWrapper.unwrapwindow.wrappedJSObject 方法。 我如何才能实现我所需要的,可能以任何其他方式?

javascript firefox firefox-addon
1个回答
0
投票

mozilla 文档说内容脚本可能会在目标页面内执行一些代码。为此,需要:

window.eval(`
<here goes the code that will have access to the page's window and objects>
`);
© www.soinside.com 2019 - 2024. All rights reserved.