2017-03-29 42 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交互,否則很容易想象,一個流氓推廣它在深度網絡中銷售公司的知識產權。