Google Plus按钮代码警告:“不安全的JavaScript尝试访问框架”在Chrome中 [英] Google Plus button code warns: "Unsafe JavaScript attempt to access frame" in Chrome

查看:149
本文介绍了Google Plus按钮代码警告:“不安全的JavaScript尝试访问框架”在Chrome中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我的网站上添加一个Google Plus按钮,尽管我在Chrome上使用Google推荐的代码,但仍然不断收到JavaScript安全警告。

I am trying to add a Google Plus button to my site, and keep getting JavaScript safety warnings, despite the fact that I am using Google's recommended code, on Chrome.

我使用直接从Google网站管理员的推荐的代码复制的代码复制了错误,没有其他补充:

I have reproduced the errors with code copied straight from Google Webmaster's recommended code, with no other additions:

<html itemscope itemtype="http://schema.org/">
<head>
<meta itemprop="name" content="Title">
<meta itemprop="description" content="Description">
</head>
<body>
<g:plusone annotation="inline"></g:plusone>
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')\[0\]; s.parentNode.insertBefore(po, s);
  })();
</script>
</body>

在Chrome中加载(Mac上为15),开发者控制台会警告:

Load this in Chrome (15 on Mac), and the developer console warns:

Unsafe JavaScript attempt to access frame with URL http://mydomain.com/ 
from frame with URL https://plusone.google.com/_/+1/fastbutton?url=http%3A%2F%2Fmydomain.com%2F&size=standard&count=true&annotation=inline&hl=en-US&jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fwidget%2F__features__%2Frt%3Dj%2Fver%3Dt6mt7PFQYRQ.en_GB.%2Fsv%3D1%2Fam%3D!agWx4Vf_ACSIFA91ZQ%2Fd%3D1%2F#id=I1_1323174311773&parent=http%3A%2F%2Fmydomain.com&rpctoken=352111652&_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe. 
Domains, protocols and ports must match.

Google网站站长建议的代码是否不安全?或者我做错了什么?

Is the Google Webmaster recommended code simply unsafe? Or have I done something wrong?

推荐答案

这是社交插件引发的常见警告。 Twitter和Facebook插件通常也会引发这种警告。您可以放心地忽略它。

This is a common warning thrown by social plugins. Twitter and Facebook plugins usually throw this warning too. You can safely ignore it.

这篇关于Google Plus按钮代码警告:“不安全的JavaScript尝试访问框架”在Chrome中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆