I noticed that all the Facebook applications that running inside an iframe hiding their iframe SRC, instead of the real src there is a "javascript:""". How can i do that? I want that my iframe will hide the original src
thanks!
The hidden attribute hides the <iframe> element. You can specify either 'hidden' (without value) or 'hidden="hidden"'. Both are valid. A hidden <iframe> is not visible, but maintains its position on the page.
Scroll down to the Miscellaneous category and click "Disable" under "Launching programs and files in an IFRAME." Click "OK" twice to save and activate your changes.
Facebook applications are loaded dynamically, which means the SRC is changed after the HTML is loaded. That is why you can only see javascript:;
. The src is not hidden though, it is still there and can be obtained using javascript.
If you are using jQuery, you could use something like this:
<iframe src="javascript:;" id="myframe"></iframe>
<script>
$(document).ready(function() {
$('#myframe').attr('src', 'http://facebook.com');
});
</script>
With this, the iframe will have javascript:;
as src in the HTML, but will load facebook.com
You are misunderstanding what you are seeing. Facebook is not "hiding" thi iframe src, it's just that the src is loaded via javascript. It's quite easy to see the iframe by using IE Developer tools (F12) or Firebug, or the native google chrome inspectors. There's nothing "hidden" about it, it just doesn't show up when you view source.
Creat elem HTML:
<div id="htmlTest"></div>
JS code:
var blobMe= URL['createObjectURL'](new Blob([''], {type: 'text/html'}));
var elIframe = document['createElement']('iframe');
elIframe['setAttribute']('frameborder', '0');
elIframe['setAttribute']('width', '100%');
elIframe['setAttribute']('height', '500px');
elIframe['setAttribute']('allowfullscreen', 'true');
elIframe['setAttribute']('webkitallowfullscreen', 'true');
elIframe['setAttribute']('mozallowfullscreen', 'true');
elIframe['setAttribute']('src', blobMe);
var idOne= 'gepa_'+ Date.now();
elIframe['setAttribute']('id', idOne);
document.getElementById('htmlTest').appendChild(elIframe);
const iframeHere= 'https://www.youtube.com/embed/GdIEi4lIH_Q';
document['getElementById'](idOne)['contentWindow']['document'].write('<script type="text/javascript">location.href = "' + iframeHere + '";</script>')
Source: https://www.nodejsauto.com/2020/08/iframe-where-src-what-is-blob.html
For me also want to hide src link in iframe. You can even refer to this url itself.
While inspect or View page source i can't able to find the src all i can find is only its id, Title & Name, is there anyway to achieve this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With