iframe doesn't display the source link - asp.net

I just noticed that some of webpages can not be viewable through frames. I have to display this website (https://mebbis.meb.gov.tr/login1.aspx) but I just don't know where to start . In addition to this, I tried couple of more websites like google, facebook, yahoo, etc... But non of them seem to be displayable through iframes either. I am not really interested in google yahoo facebook. However I have to get this website working. Does anyone out there know a workaround to fix this? Thank you
<iframe runat="server" id="mainFrame" name="main" width="100%" src="https://mebbis.meb.gov.tr/login1.aspx" style="height: 600px;">Your browser doesn't support frames.</iframe>
P.s. I am working with asp.net so any suggestion with that will be appreciated.
Why I need this : I designed a website that can take pictures of a frame so that our users can login to mebbis.gov.tr to prove that they are currently students so that they can ride the buses with reduced price. We'v been working this over a month and we are quite stuck at this point.

I have seen this recently myself within e-learning courseware, as courseware is typically loaded within an iframe.
Some websites add a setting so that they cannot be visable within an iframe. The setting is a header called "x-frame-options"
An example of this is facebook, which passes back:
x-frame-options DENY
This can be viewed in firebug under the net panel.
More details about the header are here:
https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header
EDIT
I've noticed that the link you sent doesn't have the header. Because the website is actually returning an error, it looks like it's detecting that you are loading it though an iframe in the onload javascript event and redirecting you to an error page.
if (self != top) self.location='http://mebbis.meb.gov.tr/hatali.jpg'
If a website is specifically trying to stop loading through an iframe, you probably shouldn't do so.

Related

Facebook like count accuracy issue. Showing zero even if it's not

I have a wordpress website where I integrated the facebook like button on each article. It was showing correct like counts for a while now but suddenly it began showing zero number of likes.
Upon further testing, it is showing the correct number of likes only once I, the user, has clicked the Like button itself. (and refreshing afterwards)
What could be the cause of this issue? Is this an issue with Facebook's API? or has something to do with URL? Any help will be appreciated.
This issue will happen only if you are using URL Masking for your website, which loads the page inside an iFrame on a different domain. see: http://ycouriel.blogspot.com/2009/11/hide-url-in-address-bar-using-iframe.html
The solution is to use Addon Domain instead of URL Masking (iframe).

Prevent iframe from opening in a new window

I have seen some answers about it but i have a same issue that is rather a little more complex.
I have a site about tourism build in wordpress localy and i have integrated in it some iframes from booking.com
The iframes are working good but when you click on the links inside it opens on a new window. All i want is to reload inside the iframe.
Also if some have worked with booking.com before i would like to ask...when you search from there search box and hit search is there a way not to open in a new window but instead in a new page inside the site?
In this case, due to cross-domain policy restrictions, you simply cannot control any of the booking.com iframe. That's by design, for security reasons. Unless you deal with a same-origin iframe (i.e. from the same domain name) there is nothing you can do here. You depend on booking.com's implementation entirely.
You may want to consider a plugin like http://wordpress.org/plugins/booking-search-hotel/ (found from a quick search) or see if other XML API solutions are available for more control.

Google Analytics, iframes & cross-domain

I have GA on every page on one domain (actually not me, but my company, whose programmer needs auditing). Just the default code (Classic version, ga.js), no special accommodations whatsoever that I've seen or know of. Bare minimal if any configuration past registering the service with the main site...
All the pages are either aspx or static HTML. It's common practice for this guy to embed pages on the site within other pages on the site in iframes, where both the parent (top-level) & child (embedded) pages contain the GA script.
I don't really know much at all about GA, have never worked with it, but I do suspect that might result in extra hits being counted by GA or something, that that may be messing with the metrics. But then I've read stuff about GA using first-party cookies so by default pages loaded in iframes won't be tracked/counted... I could really use some clarification on this, please.
Then our programmer frames pages from the main site in pages on other sites that we own, that are on different domains. So then there's this cross-domain business, with no segregation of sources, because they really don't care much. So what should be the outcome of that? The external sites' pages don't have the GA code.
However, we're rebuilding one of those other sites - actually I am, for the most part - and the programmer told me to just copy and paste the same exact GA script used on the main site into that one. So, it's a different domain. That wouldn't work as-is, would it? Wouldn't there have to be some sort of special configuration, setting of the domain, something?
I'd really appreciate if someone could tell me more about the scenarios described above. Thanks in advance.
In the Google Analytics developer menu, you can create a new 'profile' for this new site. The analytics will then be tracked for just that one site, not for all. In theory, it is possible to use one GA.js for all your sites, but it kind of kills the whole concept of Google Analytics, so it's not recommended.
Your really shouldn't be using iframes anymore IMO. There are reasons to use them like embedding code for tracking etc, I think, even GA uses iframes. But, generally Google doesn't like them because a lot of spammers use them to try and fool the Google Crawler.
Also, it get's very complicated to understand what is going on within GA.
To answer your question: Each iframe is like an independent webpage completely separated from the other webpage (for security reasons). So when Google or a web browser goes to your website it will do this:
Load your main html document.
Render that page.
See that you have an iframe.
Load that page in the iframe.
Render the iframe.
Now, if you don't have GA installed on the iframe page it will not track the page being loaded.
But if you do put GA in the iframe it will record when the iframe is loaded or the webpage is loaded.
But, remember that one of the main reasons of having GA is to see where your customers are coming from and why. If you have an iframe of another webpage, you really don't know if that is because a customer is:
A) visiting your website from the page directly.
OR
B) the customer is visiting that page through an iframe on another page.
It can get very complicated
You must generate a new tracker for each domain you are using. Otherwise what is to stop someone from just copying your GA code, and putting it on their webpage.

Google Analytics for mobile site

Hi I tried searching for information regarding this but get bombarded with other search results, might not be putting in the right question not sure….
Anyways hopefully someone here can help, what I’m having an issue with is my site which has a mobile version that’s separate from the main site, the mobile version can be used by anyone and has a link from the main one but anyone with a mobile device gets redirected to the mobile one. The mobile site is blind to search engines using the nofollow tag on any links that lead to it and hasn’t been cached which is what I want because it would be considered duplicate content, anyone with mobile devices gets redirected to equivalent page on mobile site.
I previously forgot to remove the analytics line from one of these pages and noticed it got cached in the search results so I removed it, which is the issue, how do I know how many people were visiting here (mobile) now etc…. Is there a way to get analytics information without having it go to the search results for duplicate content?
This seems to be a problem that can be fixed with Google Webmaster Tools, or tagging the content with a rel="canonical", please take a look at:
https://support.google.com/webmasters/answer/66359?hl=en

Correct way to link to new page in canvas page app php-sdk

I'm running in to a couple of issues and wondered if anyone had any insight. I'm using the latest php-sdk I'm developing a canvas app that has a number of different steps. These steps are spread across multiple pages. Now when I first enter the app everything seems to work fine. The access token is there and I can call the api functions. On the second page (which is linked to in the same iframe) I get OAuth errors. Now if I use this on the 2nd page:
$me = $facebook->getUser();
var_dump($me);
it returns the correct user id, but I still get errors when trying to use an api query (specifically a FQL one in this instance)
Now, bear in mind these links are within the iframe so I was assuming the signed_request is getting lost somewhere, I know facebook normally issues this via a POST. If I set all my links to target="_parent" with a url such as http://apps.facebook.com/myapp/page2.php then everything works fine. Facebook clearly posts the correct info this time. Subsequently, then when I use links that only redirect the iframe it seems to work fine again (implying a cookie is being set somewhere).
Now I've seen other apps that don't have a target="_parent" that seem to work correctly, only ever loading the iframe on subsequent clicks and not the full facebook site. So I can only assume they are storing this info somewhere. I've tried to inspect these apps using httpfox but I can't see anything obvious. Does anyone have any links for best practice with multiple page apps? I know I can get around this using full urls and target="_blank" but I would like to know what's going on here. I've looked through the developer docs and the canvas page examples, but there's nothing obvious to me.
Any help or info would be appreciated
Many Thanks
There is some ways to achieve this
using Facebook JavaScript SDK (which will set cookie for you, so PHP-SDK can rely on it)
issuing POST request to your pages including signed_request from initial page loaded in canvas

Resources