如何在https上使用Google自定义搜索以避免非安全内容提示? [英] How to use Google Custom Search on https to avoid non secure content prompt?
问题描述
有没有办法从HTTPS网站获取搜索结果的脚本
而不是 http://www.google.com/afsonline/show_afs_search.js
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
我在HTTPS网站上使用自定义Google商家搜索。
提交搜索时,网络浏览器显示警告:
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"
我尝试将来源修改为 https://www.google.com/ afsonline / show_afs_search.js
但这不起作用。从该链接返回的JavaScript仍然连接到http链接而不是https链接。
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 ?
推荐答案
对我有用的黑客是提供脚本的修改版本
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另一台服务器,比如说:
on another server, say:
https://www.myserver.com/ show_afs_search.js
只需复制原始脚本源代码,并在脚本中替换http和https(一次出现)。当然,如果谷歌改变某些东西,可能会随时停止工作。
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.
这篇关于如何在https上使用Google自定义搜索以避免非安全内容提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!