Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9207135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:19:24+00:00 2026-06-18T00:19:24+00:00

I am developing an iframe for use on a number of our partners websites.

  • 0

I am developing an iframe for use on a number of our partners websites.

Is there any way I can make sure it can only be used on those websites and not by anyone else

I was intending to add a compulsory querystring to the URL for the website.
Each partner would have a different value in the quesrystring dnd use that to look up an allowed domain

However, is there anyway to know the top level domain of the site hosting the iframe?

Presumably this is not sent in the http request for the iFrame? Or is it, I couldn’t see it?

Or do you need to send the domain from javascript?

Any advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:19:25+00:00Added an answer on June 18, 2026 at 12:19 am

    However, is there anyway to know the top level domain of the site hosting the iframe?

    Nothing reliable.

    Presumably this is not sent in the http request for the iFrame? Or is it, I couldn’t see it?

    It might be sent in the referer

    Or do you need to send the domain from javascript?

    If you want to fetch it from the framed page, you will be blocked by the same origin policy.

    If you want to sent it from the framing page, you will be putting it in the query string and you can’t trust it because it can be set to whatever the person writing the framing page likes.

    There is also the X-Frame-Options header (but that has limited browser support).

    The most reliable solution I can think of is:

    1. Require the origin to be specified in the query string used to load the frame
    2. Check the referer. If it doesn’t match your white-list and is not blank, redirect to a page that is blank except for a link to your site with target="_top" and some JavaScript that top.location = "your site"
    3. Check that the origin specified in the query string is on your whitelist, if it isn’t act in the same way as a rejected step 2
    4. Output an X-Frame-Options header that limits the framing to the specified origin

    That is likely to catch enough browsers to discourage the framing site from framing your site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing a facebook canvas (iframe) based application. Is there any way
I'm developing a product to be used by a number of customers alongside our
I am developing a Wordpress theme. In one page I have to use iframe
I am developing a webpage which our customers want to insert on their websites
Is there any standard way to know if my script has access to an
I'm developing a facebook app which can be viewed in an iframe on Facebook
i am developing an application which can play youtube video in webview using iframe.
I'm developing an IFrame application in Facebook (using pyfacebook and Django) and could not
I am developing an application with sdk 3.1 - html/javascript/scenes. i have an iframe
Developing for Android 2.3, I have a question regarding layouts. I use a vertival

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.