I have tried many properties of window to see if a page in an iframe can tell if it is in an iframe. I have tried:
if(top.location!= self.location) //doesn't work in Google Chrome
alert("I am in an iframe!")
This works for frames I would assume it also works with iFrames
if (top === self) {
// no frame
} else {
//frame
}