iframe

How to get contentWindow of the frame after the change of its cross-origin source by a script?

ⅰ亾dé卋堺 提交于 2020-04-30 09:29:10
问题 I am developing a Chrome/Firefox extension, which is intended to be used only with my own Web-application that should semi-automatically process different Web-pages in a certain specific way. In the context of this question my application is just a single Web-page, containing a single iFrame , which source is initially from the same domain. When an application's user chooses the URL of a page to be processed, this URL is assigned as the new source of the frame. To process the chosen page,

How to get contentWindow of the frame after the change of its cross-origin source by a script?

扶醉桌前 提交于 2020-04-30 09:27:30
问题 I am developing a Chrome/Firefox extension, which is intended to be used only with my own Web-application that should semi-automatically process different Web-pages in a certain specific way. In the context of this question my application is just a single Web-page, containing a single iFrame , which source is initially from the same domain. When an application's user chooses the URL of a page to be processed, this URL is assigned as the new source of the frame. To process the chosen page,

How to get contentWindow of the frame after the change of its cross-origin source by a script?

南笙酒味 提交于 2020-04-30 09:27:22
问题 I am developing a Chrome/Firefox extension, which is intended to be used only with my own Web-application that should semi-automatically process different Web-pages in a certain specific way. In the context of this question my application is just a single Web-page, containing a single iFrame , which source is initially from the same domain. When an application's user chooses the URL of a page to be processed, this URL is assigned as the new source of the frame. To process the chosen page,

YouTube iFrame Player API failed to execute postMessage on DOMWindow

徘徊边缘 提交于 2020-04-30 07:24:28
问题 I am trying to load youtube into my web page using YouTube iFrame Player API , and getting following error while loading: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://developer-sandbox.com'). both origin and target are https , there are few SO post which resolves the issue by keeping origin & target url to https. In this case both are same. Following is the JS code I am used to

best way to determine whether a webpage is viewed in an iframe

断了今生、忘了曾经 提交于 2020-04-30 05:17:06
问题 Is there a way to determine whether the user is using a web page in side and iframe or is it normal browsing using PHP? 回答1: Using the javascript code that @deceze mentioned above (I pasted it in below), if (parent.frames.length > 0) { ... } If the above code noticed the page was displayed within iframe, then call 'IAmInIFRAME.php'(just example) via ajax call. 回答2: You can add some GET parameters to the request while using IFRAME. <iframe src="http://www.example.com/iframe?iframe=1"> But

Post method not working in edge browser, but it is working in other browser like Firefox. internet explorer, chrome

允我心安 提交于 2020-04-12 07:07:10
问题 I am struggling with a post method in edge browser, while for same request i am getting response in other browsers like Internet explorer, chrome, Firefox but not in edge. While i have done lot of analysis but i could not figure out why post request is not working only in edge doubt which i have regarding behavior seen in network tabs. Please find attached snapshot of network tab(I have removed url and name from screenshot for some policy) Now question is 1. Why in protocol tab despite of

WebView with an IFRAME android

天涯浪子 提交于 2020-04-07 15:32:29
问题 I want to load an HTML <IFRAME> inside an WebView , but I don't know why, it is not able to do so. I am using following code to load <IFRAME> webView.loadData("<iframe src=\"http://www.google.com\"></iframe>", "text/html", "utf-8"); Here's what I have tried. WebSettings webViewSettings = webView.getSettings(); webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true); webViewSettings.setJavaScriptEnabled(true); webViewSettings.setPluginsEnabled(true); webViewSettings

UI自动化

℡╲_俬逩灬. 提交于 2020-04-07 08:02:10
selenium: ide -录制 webdriver -库 提供了网页的操作方法 pip3 install -U selenium 安装:ie-ieserberdriver chrome-chromedriver firefox-geckodriver 浏览器驱动:http://npm.taobao.org/mirrors/chromedriver/ 驱动版本与浏览器需要匹配,最好关闭浏览器更新功能 通信流程: 1.xxxdriver(浏览器驱动)启动,ip+端口监听 2.python selenium webdriver跟浏览器驱动建立链接,发送http请求 3.浏览器驱动收到指令,驱动浏览器做操作 4.浏览器驱动把结果返回给 python selenium webdriver 5.继续发下一个http请求 6.最后断开链接,关闭驱动,关闭浏览器 定位方式: 1.根据元素属性来查找元素: id name class_name 只支持一个class值 tag_name 2.只针对a元素: link_text partial_link_text 3.多个属性组合查找元素: xpath css_selector from selenium import webdriverimport time# 启动Chrome浏览器driver = webdriver.Chrome()#

显示用户IP来源的代码

梦想的初衷 提交于 2020-04-07 05:19:51
使用方法: 网页中直接插入代码,任意地方均可```````` 1.显示用户IP来源的代码 (468*50) <iframe width="468" height="50" frameborder="0" scrolling="no" src="http://www.cz88.net/ip/viewip468.aspx"></iframe> 2.显示用户IP来源的代码 (468*25) <iframe width="468" height="25" frameborder="0" scrolling="no" src="http://www.cz88.net/ip/viewip468_25.aspx"></iframe> 3.查询IP的代码 (468*50) <iframe width="468" height="50" frameborder="0" scrolling="no" src="http://www.cz88.net/ip/checkip.aspx"></iframe> 4.查询IP的代码 (250*50) <iframe width="250" height="50" frameborder="0" scrolling="no" src="http://www.cz88.net/ip/checkip_250_50.aspx.aspx"></iframe> 5

ajax异步登录和跨域刷新页面

ε祈祈猫儿з 提交于 2020-04-06 22:45:10
对于子页面刷新父页面,比如在a.html中嵌套了一个iframe,里面是b.html。如果a.html和b.html是同一个域,则操作b.html时要刷新父页面a.html时,很简单,通过js就能完成,在b.html中要刷新父页面的操作中加入js代码parent.location.reload();即可。 但如果a.html和b.html是来自两个不同的域,即b.html是从另一个域嵌套进来的,这时通过上面的js代码是达不到刷新父页面的目的的。这时可做一个变通的处理,即js代码可以这样写:parent.location=“www.abc/a.html”;parent.location.reload(); 其实就是写出a.html的完整路径,然后刷新这个路径即可(其中abc是我假定的一个域名)。 关于跨域刷新,一个典型的应用就是利用ajax异步登录,而登录的iframe来自另一个域,嵌套在当前页中(如首页),这么做的目的是为了在一个域中登录后,其他域可以共享登录状态(跨域是通过cookie来实现共享的)。当然,你登录完后,因为是异步,页面不会刷新,你当然希望手动刷新一下,将登录框隐藏(登录后,存了cookie,判断cookie是否存在,来判断是否登录,依据这个来决定登录框的隐藏),所以会有上面的解决方案。对于这个案例的,具体代码如下(后台的登录验证省略):