Is it possible to programmatically change the default search engine for the Iphone?

∥☆過路亽.° 提交于 2019-12-06 07:32:03

The Window object in Mobile Safari on iOS has what appear to be three undocumented functions that make interaction with the default search engine possible:

window.canSetSearchEngine()
window.getSearchEngine()
window.setSearchEngine(string)

The Yahoo mobile search site uses these functions to throw a (very annoying) dialog box asking "Would you like to change your default search engine to Yahoo? y/n".

I haven't yet been able to make the setSearchEngine() function work because for some reason I don't have permission to do so (i.e., canSetSearchEngine() returns false).

I know the Yahoo code works so it appears that it must be possible to do. I wonder if the js file has to be hosted on a whitelisted domain related to the selected search engine. IOW - perhaps only js code served from a yahoo, google, or bing domain has permission to call the setSearchEngine() function.

Cheers!

jonathanstark

Afraid not, no.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!