Content Security Policy directive: “frame-ancestors ‘self’

The content is prohibited from being displayed within an IFRAME due the Content Security Policy being set. The webserver hosting twitter.com is configured to add a HTTP header to the response object. Specifically they are setting the Content-Security-Policy tag to frame-ancestors ‘self’. There is no way you’ll be able to embed their pages into a … Read more

Scrollable box containing list of Checkboxes in HTML

CSS: .container { border:2px solid #ccc; width:300px; height: 100px; overflow-y: scroll; } HTML: <div class=”container”> <input type=”checkbox” /> This is checkbox <br /> <input type=”checkbox” /> This is checkbox <br /> <input type=”checkbox” /> This is checkbox <br /> <input type=”checkbox” /> This is checkbox <br /> <input type=”checkbox” /> This is checkbox <br /> … Read more

Angular, onLoad function on an iFrame

Commenting on a year old question. For cases where there are more than 1 iframes, I needed to bind “onload” events on to. I did this approach. Directive APP.directive(‘iframeOnload’, [function(){ return { scope: { callBack: ‘&iframeOnload’ }, link: function(scope, element, attrs){ element.on(‘load’, function(){ return scope.callBack(); }) } }}]) Controller APP.controller(‘MyController’, [‘$scope’, function($scope){ $scope.iframeLoadedCallBack = function(){ … Read more

Set iframe content height to auto resize dynamically

In the iframe: So that means you have to add some code in the iframe page. Simply add this script to your code IN THE IFRAME: <body onload=”parent.alertsize(document.body.scrollHeight);”> In the holding page: In the page holding the iframe (in my case with ID=”myiframe”) add a small javascript: <script> function alertsize(pixels){ pixels+=32; document.getElementById(‘myiframe’).style.height=pixels+”px”; } </script> What … Read more

Inserting the iframe into react component

If you don’t want to use dangerouslySetInnerHTML then you can use the below mentioned solution var Iframe = React.createClass({ render: function() { return( <div> <iframe src={this.props.src} height={this.props.height} width={this.props.width}/> </div> ) } }); ReactDOM.render( <Iframe src=”http://plnkr.co/” height=”500″ width=”500″/>, document.getElementById(‘example’) ); here live demo is available Demo

YouTube Autoplay does not work with iFrame

It’s not working since April of 2018 because Google decided to give greater control of playback to users. You just need to add &mute=1 to your URL. Autoplay Policy Changes <iframe id=”existing-iframe-example” width=”640″ height=”360″ src=”https://www.youtube.com/embed/-SFcIUEvNOQ?autoplay=1&mute=1&enablejsapi=1″ frameborder=”0″ style=”border: solid 4px #37474F” ></iframe> Update : Audio/Video Updates in Chrome 73 Google said : Now that Progressive Web … Read more

Why do people still use iframes? [closed]

I can think of 2 reasons (at the moment) why people would still use iframes instead of AJAX: 1) Iframes circumvent the cross domain origin policy (images, scripts, and styles do not). This can be useful for pulling in sites / content from other domain names relatively safely. Basically, this allows the advantage of being … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)