[英]How can I insert a <script type='text/javascript' src=''> tag on a 3rd party webpage using rails?
[英]How do I access the source code of a 3rd party style sheet loaded using a LINK tag?
我從其他網站下載了樣式表,並希望使用javascript訪問我自己頁面中樣式表的來源。 我想最終的解決方案將類似於以下內容,但source_code被正確的屬性替換。
<html>
<head>
<link id="data_item_1" rel="StyleSheet" href="http://www.someothersite.com/styles.css" type="text/css">
</head>
<body>
<p>XSS proxy data pull test</p>
<script language="javascript">
di1 = document.getElementById('data_item_1');
alert(di1.source_code);
</script>
</body>
</html>
我很確定你不能這樣做......你可以通過document.styleSheets
自己訪問這些樣式,但是你不能以這種方式查看原始源...只能訪問規則。
原始內容與原始來源之間存在一些差異:
如果您可以查看原始數據源,這將是繞過相同原始策略的一種方法...因此,不要期望這是允許的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.