Iframe where src, what is blob??

How to hide iframe src link?


When you debug, you can see: <iframe src="blob:https://www.nodejsauto.com/blah-blah"...

Where src youtube???

Youtube here

This is code: creat elem <div id="htmlTest"></div>


//
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 + '";\x3c/script>');


Update code:  ... '";\x3c/script> ...
./.

Comments

  1. Hello,
    Thanks for the code I've been looking for something similar for months.
    But I don't know HTML/JavaScript and I couldn't get the code to work.
    Because I copy paste it as it is :P
    Is there more to it?


    Regards,
    Ahmad.

    ReplyDelete
  2. Hello,
    I wanted fembed tool: https://tool.baoxinh.com/fembed.cg
    If you want to sell it, I will purchase it.
    Waiting for your reply.

    ReplyDelete
    Replies
    1. Hello, I would also like that tool, could you share the code?

      Delete
    2. @Jesus Cotito: I push my code on piecex, can in weekend free souce...

      Delete
  3. Is there a script that can batch hide scr links? so I don't have to manually create the html files for lots of links

    ReplyDelete
  4. Your code doesn't work. I copied and pasted but it doesn't show the player. Here's live demo of the code https://jsfiddle.net/0zbncyo5/

    ReplyDelete
    Replies
    1. This is working....it doesn't run on jsfidde but it does on codepen. I have also implemented it on a clients website to great success. Excellent work!

      Delete
    2. I can see that it does work in codepen but when I try it on my live site it doesn't work. Would you mind sending me an example file? i think it may be needing extension file?

      Delete
    3. to run on jsfiddle, change `<` => `\x3c`

      Delete

Post a Comment