: Can hiding site content until JavaScript determines that the site is not framed cause lower Google rankings? This is the javacript code that I use to prevent clickjacking in my current project.
This is the javacript code that I use to prevent clickjacking in my current project.
<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
Does this code affect google ranking? I also implement the X-Frame-Options Header for the site.
More posts by @Si4351233
1 Comments
Sorted by latest first Latest Oldest Best
In this case you may encounter issues as Google has very strict policies around hiding anything on the page and hiding the whole page would more than likely throw off a very big alarm bell. From what I can see there is strictly no need to hide all the page contents before trying to break the frame, just break it inherently and if it doesn't break out then show an error message in the page at the top of the page above the fold and push everything else below the fold. Shouldn't trigger any Google issues.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.