iframe

How to detect when the BROWSER blocks an iFrame

泪湿孤枕 提交于 2019-12-30 07:08:47
问题 On an https website, I'm trying to load randomly submitted URLs into an iframe, allowing the user to see that website embedded in my own user interface. As long as the remote url is https (like my own site), and the remote server doesn't explicitly block itself from being embedded in iframes, the website displays fine within the iframe. I know how to create a server-side script that can pre-detect if the iframe will be blocked due to the 3rd party's intentional iframe-blocking. However, there

Add HTML5 sandbox attribute to an iframe using Javascript

泪湿孤枕 提交于 2019-12-30 07:00:33
问题 I've got an empty iframe and a button: <input type="button" name="B1" value="google" onclick="frames['IFrameName1'].location.href='https://www.google.com/'"> But (besides .location.href) i need to set the attribute sandbox="allow-forms allow-scripts allow-same-origin , because the framed site "deframes". How to set location AND sandbox? 回答1: If you want to do two things on one click event. Have a function do both of those things and fire that function on click. window.onload = function(){ var

A way to mute an iframe using jQuery or CSS?

不打扰是莪最后的温柔 提交于 2019-12-30 07:00:11
问题 Is there a way to mute the audio of an iframe using jQuery or CSS? This is the iframe I need to mute <iframe src="http://player.vimeo.com/video/4415083?api=1;title=0&byline=0&portrait=0&color=d01e2f&autoplay=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> 回答1: Include this library in your page: https://github.com/vimeo/player-api/tree/master/javascript like this <script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script> This

Vertically center responsive iframe

杀马特。学长 韩版系。学妹 提交于 2019-12-30 06:34:08
问题 I'm using the technique described here to make an iframe (video) responsive. Essentially the iframe is absolutely positioned within a wrapper element with a 100% width. The wrapper element has it's padding set based on the aspect ratio of the video: .embed-responsive { position: relative; /* video height / video width */ padding-bottom: 56.2%; height: 0; overflow: hidden; } .embed-responsive iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } I need to be able to center

IFrame scroll bars not coming on Chrome

孤街醉人 提交于 2019-12-30 06:16:49
问题 I am using an IFrame to make show some content from some other domain. The problem is that I can use a specified height and width (which I am using) and the content inside the IFrame cannot be accommodated completely in the IFrame. Hence, I need scrollbars. I used the following html code - **<iframe style = "overflow-x:scroll; overflow-y:scroll;" src = "http://shopsocial.ly/merchant/fanpage?merchant_name=cafepress" height = "400" width = "500">** This works fine in Firefox. But in Chrome I'm

Does the technique for setting third-party cookies in iframes in Safari still work?

谁都会走 提交于 2019-12-30 06:04:25
问题 I am trying to find a way to set cookies in an iframe in Safari. Safari has a policy of not allowing iframes to set cookies unless the user clicks on something in the iframe. I have read through questions/answers on Stackoverflow and other articles. Here are some links: Facebook Iframe App with multiple pages in Safari Session Variables not persisting http://lightyearsoftware.com/2009/11/on-the-pain-of-developing-for-facebook/ http://saizai.livejournal.com/897522.html http://anantgarg.com

Fake User Agent for iframe

耗尽温柔 提交于 2019-12-30 06:03:53
问题 I'm new to Javascript. I have found this code to change user agent using Javascript. var __originalNavigator = navigator; navigator = new Object(); navigator.__defineGetter__('userAgent', function () { return 'Custom'; }); var iframe='<iframe id="frame" name="widget" src ="http://www.useragentstring.com/" width="100%" height="400" marginheight="0" marginwidth="0" frameborder="no" scrolling="no"></iframe>'; document.write("User-agent header sent: " + navigator.userAgent + iframe); This code

How to make a video fullscreen when it is placed inside an iframe?

懵懂的女人 提交于 2019-12-30 05:43:25
问题 I'm using the default settings for my mediaelement.js player, and my initialization is very basic: $('video').mediaelementplayer(); My question is: Is it possible to fullscreen the player when the video is embedded in an iframe? When I press fullscreen, the video maximizes to the iframe but not to the entire screen however. Is this a limitation of html or is there a way to get around it? The general structure looks like this: <!DOCTYPE html> <html> <head /> <body> <iframe> <!DOCTYPE html>

CSS: How to have to divs side by side with height 100%?

六眼飞鱼酱① 提交于 2019-12-30 05:34:04
问题 I am trying to create a two div's side by side that fill my screen 100%. The left div contains some menu and the right the content. Here's the code I have at the moment: http://jsfiddle.net/HpWZW/ . The current problem is the height is only as large as my smallest div's content. So in this case my iframe in the right column is larger than my menu items in the left column; however, the height is limited to the left divs contents not the right. Any ideas? Thanks! Code <div> <div class="table">

What is iframe used for? [closed]

怎甘沉沦 提交于 2019-12-30 05:32:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago . What is the purpose of the iframe tag in HTML? What is it used for? 回答1: An <iframe> is used for containing (X)HTML documents in other (X)HTML documents. This enables updates of parts of a website while the user