0
之间的沟通我有我的内容脚本下面的代码是调用在网页中的javascriptChrome扩展:内容脚本和网页的脚本
var actualCode = '(' + function() {
functionInMyWebPage();
}
+ ')();';
var script = document.createElement('script');
script.textContent = actualCode;
(document.head||document.documentElement).appendChild(script);
script.parentNode.removeChild(script);
功能这是工作,它激发了functionInMyWebPage()
功能。
现在我需要获得这个functionInMyWebPage()
的返回值并调用在内容脚本本身中定义的另一个函数。如果我在上面的脚本块中调用它,它会抱怨,因为它没有定义。
人谁下投票请解释一下原因!你的答案可以是任何事情,但是要回答一个问题,你需要有足够的证据证明这是一个愚蠢的问题! –