Html 奇怪的 iframe 添加到名为“rufous-sandbox”的 body 标签中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12133617/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:29:50  来源:igfitidea点击:

Strange iframe added into body tags called `rufous-sandbox`

htmlwordpress

提问by Alex McGill

I'm working on a local WordPress site, and for some reason there is an iframeadded just after the opening bodytag which makes the body to drop down about 20px.

我正在一个本地 WordPress 网站上工作,出于某种原因iframe,在开始body标记之后添加了一个,使正文下降约 20 像素。

Google only returned 1 relevant result when searching for it, and what I read there didn't help much. It can be found here.

谷歌在搜索时只返回 1 个相关结果,我在那里读到的内容没有多大帮助。可以在这里找到。

The WordPress site has no plugins installed, and setting it to display: none;doesn't work.

WordPress 站点没有安装插件,将其设置为display: none;不起作用。

Here's a screenshot from Chrome so you can see it:

这是Chrome的屏幕截图,您可以看到它:

enter image description here

在此处输入图片说明

回答by S?ren Dam

It seems like it is added by the Twitter script. If you remove it the iframe will disappear. It sure looks like you have the Twitter plugin installed in some way or the other as you can see it says data-twttr-rendered="true" in the body tag.

它似乎是由 Twitter 脚本添加的。如果删除它,iframe 将消失。看起来您确实以某种方式安装了 Twitter 插件,因为您可以看到它在 body 标签中显示 data-twttr-rendered="true"。

If you remove the code - in my case the code below - it will disappear

如果您删除代码 - 在我的情况下是下面的代码 - 它会消失

<script type="text/javascript">
  (function(){
    var twitterWidgets = document.createElement('script');
    twitterWidgets.type = 'text/javascript';
    twitterWidgets.async = true;
    twitterWidgets.src = '//platform.twitter.com/widgets.js';
    document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
  })();
</script>