302重定向后获取flash src或嵌入/ object/iframe标记内的元素(跨域)

6 html javascript embed flash element

URL example.com/redir将自动将用户(HTTP 302)重定向到example.com/ hi.SWF?message = Message + Value.

如何在以下示例中使用javascript或flash获取消息值?

<!DOCTYPE html>
<html>
    <body>
         <embed id="foo" src="https://example.com/redir"></embed>
         <!-- Remember that example.com/redir will be automatically redirected to example.com/hi.SWF?message=Message+Value -->

         <!-- The code to get the message value must go here -->

    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

考虑一下:

  1. 上面的.html托管在cross-domain.com中,就像解决方案中涉及的任何其他文件一样(.swf,.js,.html,.css等);
  2. 您无法控制example.com ;
  3. 你无法控制hi.SWF ;
  4. 您可以将<embed>标记更改为<object><iframe> ;

Luc*_* NN 0

简单回答:

由于同源策略,您不能这样做。
您的请求中不会携带用户的cookie。