From 36a63a2498fc2fb8422d5681273088570d3e7776 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Sun, 10 Jan 2016 17:05:29 +0530 Subject: [PATCH] Revert onload changes due to side effects Signed-off-by: Atul Pratap Singh --- js/cross_framing_protection.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/js/cross_framing_protection.js b/js/cross_framing_protection.js index 70e298b9ac..91e9aa9e49 100644 --- a/js/cross_framing_protection.js +++ b/js/cross_framing_protection.js @@ -2,15 +2,13 @@ /** * Conditionally included if framing is not allowed */ -$(function () { - if (self == top) { - var style_element = document.getElementById("cfs-style"); - // check if style_element has already been removed - // to avoid frequently reported js error - if (typeof(style_element) != 'undefined' && style_element != null) { - style_element.parentNode.removeChild(style_element); - } - } else { - top.location = self.location; +if (self == top) { + var style_element = document.getElementById("cfs-style"); + // check if style_element has already been removed + // to avoid frequently reported js error + if (typeof(style_element) != 'undefined' && style_element != null) { + style_element.parentNode.removeChild(style_element); } -}); +} else { + top.location = self.location; +}