Archived topic
How to present URL be used in other website
7 replies · Started by Jason on May 6, 2022
Hi
I used lots of iFrame element to show the html5 file made by some authoring tool (Storyline3). These files should be only viewed by the registered participants.
But I noticed that these files's URL can be viewed in the code sources of browsers and reused again outside of my website.
for example
<iframe src="https://www.w3schools.com/xx/xx/xx"></iframe>
Do you have any ways to solve this problem?
Thanks very much.
Regards
Jason
Hi Jason,
You’ll probably need custom Javascript to do as such.
See this for reference: https://www.quora.com/How-do-you-hide-an-iframe-URL-in-an-HTML-source-code
You can add JS through a Hook Element hooked to wp_footer.
Hope this clarifies. :)
Hi Fernando,
Thanks for your help.
I am still kind of confused on how to get it done
This is the steps I thought after review of your suggestion.
Step ONE: Create a Hook Element which I named it " hide an iframe url"
What code should I put here?
Step TWO: If I do not provide the URL in the iframe, how can I add URL in the Hook for each pages?
Step THREE: In the HTML block element, what should I put here?
I got two different answers as below
3.1)
<html>
<body>
<iframe id="iframe" src=""></iframe>
<script src="main.js"></script>
</body>
</html>
3.2)
<body>
<iframe src="" />
</body>
Thanks for your help.
Regards
Jason
Hi there,
are you hosting the iframes or are they provided by a 3rd party?
because unless you can edit the iframes code, so it includes Javascript to check for the top level domain, its virtually impossible to stop someone from grabbing the URL from that iframe and using it elsewhere.
Hi David
Thanks. I understood now.
I got one advice to use a plugin called omniOrange prevent files/folders access, which keep the h5 files in their protected folders.
I am hosting the iFrame and edit the code as you mentioned.
Do you think that this could in the end solve this issue?
Thanks for your advice.
Regards
Jason
Plugin sounds good :) Alternatives ... Have a look into X-Frame-Options:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
Or Frame Ancestors:
Or maybe a simple JS trick to check the top level domain in the iFrame.
Thanks David
I will check again
You're welcome