iframe

Displaying local htm file in iframe?

橙三吉。 提交于 2020-01-02 09:54:17
问题 I am saving some emails on my local machine using MailBee.NET Objects in htm format. A separate folder is created for each email using email messageID on server for example D:\Emails\GmailId1380ec660e0e656a\doc.htm is an email downloaded from gmail. I am saving also the above mentioned path in database so I can use it later. Now I am trying to display this htm file in an iframe but it is not working. A user clicks on email which takes him to the read_email page on which I am trying to assign

Is it possible to get contents of iframe in selenium webdriver python?

☆樱花仙子☆ 提交于 2020-01-02 09:09:32
问题 In web testing, I plan to get contents of iframe(/htme/body/p), is it possible? I use this method to set contents of iframe: driver.switch_to_frame(driver.find_element_by_xpath("//iframe[contains(@title,'ALT')]")) driver.switch_to_active_element() time.sleep(1) driver.execute_script(("document.body.innerHTML = '%s'" % recurWorkflowTestData["inputEditor"][inputNotes])) time.sleep(1) driver.switch_to_default_content() 回答1: To follow the same logic, you can get the document.body.innerHTML back:

Embedding an Iframe having CSP 2.0 in a mobile app: “frame-ancestors” issue

蓝咒 提交于 2020-01-02 08:54:11
问题 Building an hybrid app with the Ionic framework, I need to embed to one of my page an Iframe. My problem is that the page loaded with the iframe does have the following CSP: "frame-ancestors http://foo.somedomain.com" Which works just fine on my browser. However whenever I try this on the application itself the content is not loaded due to: Refused to display 'http://foo.somedomain.com' in a frame because an ancestor violates the following Content Security Policy directive "frame-ancestors

Modifying X-Frame Options on an IFRAME through Node.JS?

我怕爱的太早我们不能终老 提交于 2020-01-02 06:31:11
问题 Is it possible to modify the Response Headers for an IFRAME in a Node.JS application? Do you have to create a proxy first? ( Something similar to this? http://www.bennadel.com/blog/2179-Extending-EventEmitter-In-Order-To-Create-A-Response-Proxy-In-Node-js.htm ) I basically want to be able to show the mobile version of Gmail within an IFRAME. 回答1: In general the answer is yes, you would have to proxy it. However in this particular case, that may not even work - Google seems to have deployed

How to insert html in iframe

亡梦爱人 提交于 2020-01-02 06:21:28
问题 Hallo all: I need to insert a html string in a iframe as shown below: .... var html = "<html><head><title>Titolo</title></head><body><p>body</p></body></html>" jQuery('#popolaIframe').click(function() { parent.$("#indexIframe")[0].documentElement.innerHTML = html; }); Is there a way to achieve this? 回答1: var html = "<html><head><title>Titolo</title></head><body><p>body</p></body></html>" jQuery('#popolaIframe').click(function() { var doc = parent.$("#indexIframe")[0].documentElement; doc.open

跨域请求的解决方案

江枫思渺然 提交于 2020-01-02 05:49:51
首先我们来想一想 1.跨域是什么呢?为何要跨域? 2.浏览器的同源策略又是什么? 3.跨域的原理又是什么呢? 4.解决跨域有哪些方法? 当两个域具有相同的协议(如http), 相同的端口(如80),相同的host(如www.google.com),则认为它们是相同的域(协议,域名,端口都必须相同),否则就是跨域,如图所示: 同源策略:比如:我在本地上的域名是abc.cn,请求另外一个域名的一段数据,这个时候在浏览器上会报错,这个就是同源策略的保护。如果浏览器对javascript没有同源策略的保护,那么一些重要的机密网站将会很危险 限制跨域访问作用 限制跨域资源访问的作用可从服务器和客户端两个方面进行分析: 1、对于服务器,当收到一个请求时,会检查该请求来源,如果来源的客户端页面自己无法识别,而且服务器的数据又是比较敏感的,则可能做出限制或者拒绝访问(例如,黑客对服务器的攻击)。 2、对于客户端,浏览器的同源策略可限制对跨域资源的访问,若其与服务器的域不相同,则浏览器可能进行限制甚至拒绝访问(例如,黑客通过让你访问他的服务器数据来攻击你的客户端页面)。 跨域访问失败时,实际上浏览器发送请求成功,浏览器也接收到了响应,但是它会限制xmlhttprequest接受响应并在js控制台报错。 跨域解决方案 1、 通过jsonp跨域 2、 document.domain + iframe跨域

跨域详解

半腔热情 提交于 2020-01-02 05:49:24
什么是跨域? 跨域是指一个域下的文档或脚本试图去请求另一个域下的资源,这里跨域是广义的。 广义的跨域: 1.) 资源跳转: A链接、重定向、表单提交 2.) 资源嵌入: <link>、<script>、<img>、<frame>等dom标签,还有样式中background:url()、@font-face()等文件外链 3.) 脚本请求: js发起的ajax请求、dom和js对象的跨域操作等 其实我们通常所说的跨域是狭义的,是由浏览器同源策略限制的一类请求场景。 什么是同源策略? 同源策略/SOP(Same origin policy)是一种约定,由Netscape公司1995年引入浏览器,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,浏览器很容易受到XSS、CSFR等攻击。所谓同源是指"协议+域名+端口"三者相同,即便两个不同的域名指向同一个ip地址,也非同源。 同源策略限制以下几种行为: 1.) Cookie、LocalStorage 和 IndexDB 无法读取 2.) DOM 和 Js对象无法获得 3.) AJAX 请求不能发送 常见跨域场景 URL 说明 是否允许通信 http://www.domain.com/a.js http://www.domain.com/b.js 同一域名,不同文件或路径 允许 http://www.domain.com/lab/c

前端解决跨域的九种方法

允我心安 提交于 2020-01-02 05:44:35
什么是跨域? 跨域是指一个域下的文档或脚本试图去请求另一个域下的资源,这里跨域是广义的。 广义的跨域: 1、 资源跳转:A链接、重定向、表单提交 2、 资源嵌入: < link>、 < script> 、 < img>、 < frame>等dom标签,还有样式中background:url()、@font-face()等文件外链 3、 脚本请求: js发起的ajax请求、dom和js对象的跨域操作等 其实我们通常所说的跨域是狭义的,是由浏览器同源策略限制的一类请求场景。 什么是同源策略? 同源策略/SOP(Same origin policy)是一种约定,由Netscape公司1995年引入浏览器,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,浏览器很容易受到XSS、CSFR等攻击。所谓同源是指"协议+域名+端口"三者相同,即便两个不同的域名指向同一个ip地址,也非同源。 同源策略限制以下几种行为: 1、Cookie、LocalStorage 和 IndexDB 无法读取 2、 DOM 和 Js对象无法获得 3、 AJAX 请求不能发送 常见跨域场景 URL 说明 是否允许通信 http://www.demo.com/a.js http://www.demo.com/b.js 同一域名,不同文件或路径 允许 http://www.demo.com/lab/c.js

js跨域请求解决方案

*爱你&永不变心* 提交于 2020-01-02 05:42:03
什么是跨域? 跨域是指一个域下的文档或脚本试图去请求另一个域下的资源,这里跨域是广义的。 广义的跨域: 1.) 资源跳转: A链接、重定向、表单提交 2.) 资源嵌入: <link>、<script>、<img>、<frame>等dom标签,还有样式中background:url()、@font-face()等文件外链 3.) 脚本请求: js发起的ajax请求、dom和js对象的跨域操作等 其实我们通常所说的跨域是狭义的,是由浏览器同源策略限制的一类请求场景。 什么是同源策略? 同源策略/SOP(Same origin policy)是一种约定,由Netscape公司1995年引入浏览器,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,浏览器很容易受到XSS、CSFR等攻击。所谓同源是指"协议+域名+端口"三者相同,即便两个不同的域名指向同一个ip地址,也非同源。 同源策略限制以下几种行为: 1.) Cookie、LocalStorage 和 IndexDB 无法读取 2.) DOM 和 Js对象无法获得 3.) AJAX 请求不能发送 常见跨域场景 URL 说明 是否允许通信 http://www.domain.com/a.js http://www.domain.com/b.js 同一域名,不同文件或路径 允许 http://www.domain.com/lab/c

Read HTML code from iframe using Webbrowser C#

时光总嘲笑我的痴心妄想 提交于 2020-01-02 04:54:13
问题 How to read IFRAME html code using WebBrowser? I have site with iframe, and after few clicks new URL opens inside this IFRAME with some portion of HTML CODE. Is there a possiblity to read this?. When I am trying to Navigate() to this URL, I am redirected to main page of this site (it is not possible to open this link twice). Uri IFRAME_URL = webBrowser1.Document.Window.Frames[0].Url; Maybe there is something similar to: Uri IFRAME_URL = webBrowser1.Document.Window.Frames[0]. ... DOCUMENTTEXT;