开发者

External iframe source-code (Firebug, Selenium...)

开发者 https://www.devze.com 2023-03-02 14:41 出处:网络
1) I have an external iframe, and I wondered how Selenium or Firebug managed to overcome the Same Origin Policy to retrieve source code (or even execute some JavaScript)

1) I have an external iframe, and I wondered how Selenium or Firebug managed to overcome the Same Origin Policy to retrieve source code (or even execute some JavaScript)

As for Firebug, I think this has to do with cd(frames[0]) command. In Selenium, you can access content in the iframe with an xpath link, but I have no i开发者_StackOverflowdea how it internally works.

2) Is it possible to use similar methods outside of a Firefox plugin?

3) What about IE? (or Chrome, but it is way less important)

Thank you :-)


The way that Selenium and Firebug get around it is buy running in the browser chrome rather than in the JavaScript sandbox. For example, calling *firefox calls the slightly less secure version of the browser, by less secure I mean it is running in more of the browser chrome than your average user, and can do the relevant calls.

Addons and Extensions to Firefox run in this context too so can access things in the same way.

0

精彩评论

暂无评论...
验证码 换一张
取 消