NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
# iframe_embed_settings 标签   这个标签在文件:horizon\openstack_dashboard\templatetags\context_selection.py中被 定义。其代码 如下: ~~~ @register.inclusion_tag('context_selection/_anti_clickjack.html', takes_context=True) def iframe_embed_settings(context): disallow_iframe_embed = getattr(settings, 'DISALLOW_IFRAME_EMBED',True) context = {'disallow_iframe_embed': disallow_iframe_embed} return context ~~~ 'context_selection/_anti_clickjack.html' 这个文件对就路径为: horizon\openstack_dashboard\templates\context_selection\_anti_clickjack.html 。其里面的内容为: ~~~ {% if disallow_iframe_embed %} <style id="anti-clickjack">body{display:none !important;}</style> <script type='text/javascript' charset="utf-8"> if (self === top) { var antiClickjack = document.getElementById("anti-clickjack"); antiClickjack.parentNode.removeChild(antiClickjack); } else { top.location = self.location; } </script> {% endif %} ~~~ 这段JS代码就被引入了。