如何在https上使用Google自定义搜索以避免非安全内容提示?
有没有办法从 HTTPS 站点获取搜索结果的脚本 而不是 http://www.google.com/afsonline/show_afs_search.js
。
我在 HTTPS 网站上使用自定义 Google 商业搜索, 提交搜索时,网络浏览器显示警告:
"This page contains both secure and nonsecure items"
我尝试将源修改为 https://www.google.com/afsonline/show_afs_search.js
但这不起作用。从该链接返回的 JavaScript 仍然连接到 http 链接而不是 https 链接。
有人知道如何解决这个问题吗?
Is there a way to get the script for search results from an HTTPS site
instead of http://www.google.com/afsonline/show_afs_search.js
I am using the custom google business search on a HTTPS site.
When search is submitted web browser shows warning:
"This page contains both secure and nonsecure items"
I tried to modify the source to be https://www.google.com/afsonline/show_afs_search.js
but that doesn't work. Still JavaScript returned from that link connects to http links instead of https links.
Does anybody knows how to fix this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对我有用的方法是提供脚本的修改版本
https://www.google.com/afsonline/show_afs_search .js
在另一台服务器上,说:
https://www.myserver.com/show_afs_search.js
只是复制原始脚本源代码并将脚本中的“http”替换为“https”(出现一次)。当然,如果谷歌改变了一些东西,这可能会随时停止工作。
A hack that works for me is to provide a modified version of the script
https://www.google.com/afsonline/show_afs_search.js
on another server, say:
https://www.myserver.com/show_afs_search.js
Just copy the original scripts source code and replace 'http' with 'https' in the script (one occurrence). Of course that might stop working anytime if Google changes something.
即使您将 Javascript 链接修改为 HTTPS,
show_afs_search.js
仍然会被硬编码为通过 HTTP(而不是 HTTPS)获取搜索结果。为了避免此错误,请制作您自己的show_afs_search.js
副本,通过 HTTPS 获取结果。步骤:
show_afs_search.js
Even if you modify the Javascript link to HTTPS,
show_afs_search.js
is still hardcoded to get the search results via HTTP, not HTTPS. To avoid this error, make your own copy ofshow_afs_search.js
that grabs results via HTTPS.Steps:
show_afs_search.js
只需将 http 的一个实例更改为 https 即可。
Just change the one instance of http to https.