iframe

NS_ERROR_FAILURE in Firefox on setting font of canvas inside a hidden iframe

只愿长相守 提交于 2020-01-15 03:22:07
问题 I am trying to create a text editor using a canvas . To place the cursor at the right position I need to calculate the width of every character. I am caching the width of each character on initial load. This works fine on Firefox when launched directly but throws an error ( NS_ERROR_FAILURE ) when launched inside an iframe whose parent is hidden. I've narrowed down this case in a fiddle here. Can anyone help me out with the cause of this issue? 回答1: You can't have an iframe set to display

iframe content with style in head with hex color code not working

落花浮王杯 提交于 2020-01-15 03:16:06
问题 I am generating iframe using javascript with dynamic html. My dynamic html looks like- <head> <style> ... .bar {background-color: #EB593C;} ... </style> </head> Then iframe contents all code till .bar {background-color: after color code html/css is not included in iframes contents. If I replace hex color code with rgb or text color name then that is working fine. But as I said html is dynamic so I cant replace all the hex color codes to to rgb or text. var iframe = document.createElement(

selenium自动化测试-处理iframe

偶尔善良 提交于 2020-01-14 19:51:20
Selenium自动化测试-iframe处理 上一篇,我们介绍了元素的内容、属性、状态信息。写自动化脚本时会遇到 iframe嵌套页面,这时直接定位是不行的,今天我们要介绍怎么处理iframe定 iframe是HTML标签,作用是文档中的文档,或者浮动的框架(FRAME)。iframe元素会创建包含另外一个文档的内联框架(即行内框架), 作用就是嵌套网页。 以163网易邮箱账号或手机号码输入框为例,我们先按正常定位方法试下能否定位成功。 代码如下: 报错信息如下: Traceback (most recent call last): ...... raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable (Session info: chrome=76.0.3809.132) 让我们定位到元素看下到底发生了什么 我们发现要定位的这个元素在当套的iframe页面里,我们要操作这个元素,需要先切换到iframe页面,才能正常定定位 <iframe name="" frameborder="0" id="x-URS-iframe1570682661270

How to use Iframe in react native?

风格不统一 提交于 2020-01-14 18:52:09
问题 I try to find any way to add Iframe to my react native app. I found react-iframe, but it didn't work for me. I followed document. I just import react-iframe and copy Iframe tag to use. My result is like image below. I need other way to use Iframe in react native app. Thank you. 回答1: Try to use WebView: import { WebView } from 'react-native'; .... <WebView scalesPageToFit={true} bounces={false} javaScriptEnabled style={{ height: 500, width: 300 }} source={{ html: ` <!DOCTYPE html> <html> <head

HTML5 Iframe: Block remote requests

为君一笑 提交于 2020-01-14 15:54:49
问题 I am loading HTML content into an iframe using the srcdoc property. The iframe is a sandboxed iframe with no permissions given, so all Javascript in the iframe is blocked. However, remote requests (such as for CSS, images etc.) will still be triggered inside the iframe. Is there any possible way to tell the iframe to only load what I give it in the srcdoc property and not make any additional requests? Thanks in advance 回答1: The basics Presumably no because sandboxing the iframe is meant to

HTML5 Iframe: Block remote requests

☆樱花仙子☆ 提交于 2020-01-14 15:54:29
问题 I am loading HTML content into an iframe using the srcdoc property. The iframe is a sandboxed iframe with no permissions given, so all Javascript in the iframe is blocked. However, remote requests (such as for CSS, images etc.) will still be triggered inside the iframe. Is there any possible way to tell the iframe to only load what I give it in the srcdoc property and not make any additional requests? Thanks in advance 回答1: The basics Presumably no because sandboxing the iframe is meant to

Vue中对iframe实现keep alive

依然范特西╮ 提交于 2020-01-14 15:22:45
前言 最近一个需求,需要在 Vue 项目中加入 含有iframe 的页面,同时在路由切换的过程中,要求iframe的内容 不会被刷新 。一开始使用了Vue自带的keep- alive发现没有用,于是自己研究了一下解决方案。。。。。。 Vue的keep-alive原理 要实现对保持iframe页的状态。我们先搞清楚为什么Vue的keep-alive不能凑效。keep-alive原理是把组件里的节点信息保留在了 VNode (在内存里),在需要渲染时候从Vnode渲染到真实DOM上。iframe页里的内容并不属于节点的信息,所以使用keep-alive依然会重新渲染iframe内的内容。 另外 ,我也尝试有过想法:如果把整个iframe节点保存起来,然后需要切换时把它渲染到目标节点上,能否实现iframe页不被刷新呢?————也是不可行的,iframe每一次渲染就相当于打开一个新的网页窗口,即使把节点保存下来,在渲染时iframe页还是刷新的。 实现的思路 既然保持iframe页里的状态很难实现,在这个时候我想到了一个别的方法。能否在Vue的route-view节点上动点手脚?使得在切换 非iframe页 的时候使用Vue的路由,当切换 iframe页 时则使用 v-show 切换显示与隐藏,使得iframe节点 一直不被删除 ,这样就能保持iframe的状态了。

Using iframe for “long polling” withouth causing flashing browser

大城市里の小女人 提交于 2020-01-14 14:45:16
问题 I need to check if commands are written to a txt file in order to update a 3D window inside my web browser. This is what is known as "push" technique or long polling to notify the client. As the browser has to be Internet Explorer I am a bit limited. I have come up with a solution using a hidden iframe that calls a php script that reloads every second to check the txt file. <iframe noresize scrolling="no" frameborder="0" name="loader" src="loader.php"> The loader.php basically does this: /

Chrome app: accessing sandboxed iframe from parent window

冷暖自知 提交于 2020-01-14 13:45:35
问题 I'm using knockoutjs in my google chrome app. To be able to use knockout, I have to define the real application.html as sandox page and include it as an iframe in a dummy container. Application structure is as follows: - container.html | +-- application.html as iframe | +-knockout and application.js Iframe is defined as follows: <iframe src="application.html" frameborder="0" sandbox="allow-same-origin allow-scripts" ></iframe> Running document.getElementsByTagName("iframe")[0] in inspect tool

iframe像父级传值

南笙酒味 提交于 2020-01-14 11:27:18
iframe页面中: test.onclick = function () { var autoMessage = {"name":"三三"}; window.parent.postMessage(autoMessage,'*') } 父页面中: window.addEventListener('message',function(e){ let data = e.target; console.log(e.data); },false); 来源: https://www.cnblogs.com/pyx-blog/p/12190474.html