2017-03-29 43 views
1

我正在使用TFS,并试图将扩展(网页)上传到仪表板。 当仪表板加载我的扩展时,它会使用Iframe将其包装。js/jquery - 如何从iframe中更改现有的iframe属性

TFS Iframe example

iframe的沙箱属性缺少允许-同源这让我来操作,它包含我的扩展页面。 有没有办法改变我的扩展网页的iframe属性? 整个页面的样子:

<html> // Tfs page 
<body> 
<div> // main page 
    <iframe sandbox='allow-scripts ...'> // the iframe that wrapps my extension, missing 'allow-same-origin' 
     <html> // my extension 
     <body> 
     ... 
     </body> 
     </html> 
    </iframe> 
</body> 
</html> 

谢谢...

+0

我有完全相同的问题。我想添加一个嵌入外部网站的新中心(项目)。你有没有解决它? – Andreas

+0

不,这是不可能的。 – Yardenh

+0

[这里是msdn论坛的链接,我问了同样的问题](https://social.msdn.microsoft.com/Forums/vstudio/en-US/66a1a13d-59a2-4b52-9c03-4df2bd7792ac/change -frame-sandbox-attribute-after-uploadloading-an-extension?forum = tfsgeneral)@Andreas – Yardenh

回答

0

我认为这是故意的:你应该使用SDK与VSTS/TFS交互,否则很容易想象,一个流氓推广它在深度网络中销售公司的知识产权。