Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy browsers Frame Breaking js code usage and deprecate it #11679

Closed
Closed
22 changes: 0 additions & 22 deletions libraries/cms/html/behavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,28 +800,6 @@ public static function noframes()
return;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrepereiradasilva Can you also put depreciation tag on this function?

// Include core
static::core();

// Include jQuery
JHtml::_('jquery.framework');

$js = 'jQuery(function () {
if (top == self) {
document.documentElement.style.display = "block";
}
else
{
top.location = self.location;
}

// Firefox fix
jQuery("input[autofocus]").focus();
})';
$document = JFactory::getDocument();
$document->addStyleDeclaration('html { display:none }');
$document->addScriptDeclaration($js);

JFactory::getApplication()->setHeader('X-Frame-Options', 'SAMEORIGIN');

static::$loaded[__METHOD__] = true;
Expand Down