如何打印(在屏幕上)带有外部 url 的 iframe 所需的所有 JS 代码

How to print (in the screen) all JS code required by an iframe with external url

我想在一个iframe中显示一个网页(一个外部url),然后在一个textarea中显示这个iframe请求的所有代码JS。

它就像一个 firebug 控制台(我们可以在其中看到所有脚本及其源代码),但我只能使用前端语言(可以是任何库,甚至可以是纯 javascript)。

我有一个跨域问题,即使我能够执行请求(比如使用 getScript),我也无法获取源代码,代码本身...没有 "textResponse" ...

我该怎么做?可能吗?

可以获取此信息,但是需要使用服务器。

但是,它不一定是您的 服务器,您可以使用第 3 方服务器来获取此信息。其中一项服务是 YQL。

https://developer.yahoo.com/yql/console/#h=select+script+from+html+where+url%3D'http%3A%2F%2Ftrello.com'+AND+script.src+!%3D+''