在手机Safari中打开的"googlechrome://www.lego.com"将切换到谷歌Chrome iOS应用程序以打开URL.这允许像下面那样的scriptlet,它允许您在Google Chrome iOS应用中打开当前页面,从移动Safari切换:
(function()%7Bif(document.location.href.indexOf('http')===0)document.location.href=document.location.href.replace(/%5Ehttp/,'googlechrome');%7D)();
Run Code Online (Sandbox Code Playgroud)
我的问题是,可以反过来做吗?我试过"safari://www.lego.com",它只是一个无效的网址.您可以制作一个从 Google Chrome 切换到移动版Safari 的Scriptlet 来打开当前页面.