从IE浏览器链接跳转到谷歌浏览器方法
private openChrome(uri: any) { uri = uri.split('&').join('^&'); // 转义 // ActiveObject仅在IE下可创建 需要在IE internet选项中配置安全级别才行具体详见百度 var objShell = new ActiveXObject("WScript.Shell"); // 注意这里是/c,不可使用/k,否则资源不会释放 双引号包起来转义空格 // var cmd = 'cmd.exe /c start "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" ' + uri; // var cmd = `cmd.exe /c start "" chrome.exe --kiosk --fullscreen --incognito ${uri}`; // var cmd = `cmd.exe /c start "" chrome.exe --fullscreen ${uri}`; var cmd = 'cmd.exe /c start "" chrome.exe --fullscreen ' + uri; objShell.Run(cmd, 0, true); }
遇到相关错误解决方法:
1.报没有权限 添加受信任站点 并受信任站点更改自定义级别 2.运行.cmd文件 3.依次cmd中执行 regsvr32 c:/WINDOWS/system32/shell32.dll regsvr32 c:/WINDOWS/system32/WSHom.Ocx regsvr32 c:/WINDOWS/system32/scrrun.dll 4. regsvr32 scrrun.dll 5.internet自定义级别和本地自定义级别设置详见百度 6.报promise拒绝访问 js处理 catch 7.其他帮助: https://www.jb51.net/article/9772.htm https://blog.csdn.net/wangyc_/article/details/107514340 以下为第2步内容: echo 正在修复,这个过程可能需要几分钟,请稍候…… rundll32.exe advpack.dll /DelNodeRunDLL32 %systemroot%\System32\dacui.dll rundll32.exe advpack.dll /DelNodeRunDLL32 %systemroot%\Catroot\icatalog.mdb regsvr32 /s comcat.dll regsvr32 /s asctrls.ocx regsvr32 /s oleaut32.dll regsvr32 /s shdocvw.dll /I regsvr32 /s shdocvw.dll regsvr32 /s browseui.dll regsvr32 /s browseui.dll /I regsvr32 /s msrating.dll regsvr32 /s mlang.dll regsvr32 /s hlink.dll regsvr32 /s mshtml.dll regsvr32 /s mshtmled.dll regsvr32 /s urlmon.dll regsvr32 /s plugin.ocx regsvr32 /s sendmail.dll regsvr32 /s mshtml.dll /i regsvr32 /s scrobj.dll regsvr32 /s corpol.dll regsvr32 /s jscript.dll regsvr32 /s msxml.dll regsvr32 /s imgutil.dll regsvr32 /s cryptext.dll regsvr32 /s inseng.dll regsvr32 /s iesetup.dll /i regsvr32 /s cryptdlg.dll regsvr32 /s actxprxy.dll regsvr32 /s dispex.dll regsvr32 /s occache.dll regsvr32 /s iepeers.dll regsvr32 /s urlmon.dll /i regsvr32 /s cdfview.dll regsvr32 /s webcheck.dll regsvr32 /s mobsync.dll regsvr32 /s pngfilt.dll regsvr32 /s licmgr10.dll regsvr32 /s hhctrl.ocx regsvr32 /s inetcfg.dll regsvr32 /s trialoc.dll regsvr32 /s tdc.ocx regsvr32 /s MSR2C.DLL regsvr32 /s msident.dll regsvr32 /s msieftp.dll regsvr32 /s xmsconf.ocx regsvr32 /s ils.dll regsvr32 /s msoeacct.dll regsvr32 /s wab32.dll regsvr32 /s wabimp.dll regsvr32 /s wabfind.dll regsvr32 /s oemiglib.dll regsvr32 /s directdb.dll regsvr32 /s inetcomm.dll regsvr32 /s msoe.dll regsvr32 /s oeimport.dll regsvr32 /s msdxm.ocx regsvr32 /s dxmasf.dll regsvr32 /s laprxy.dll regsvr32 /s l3codecx.ax regsvr32 /s acelpdec.ax regsvr32 /s mpg4ds32.ax regsvr32 /s danim.dll regsvr32 /s Daxctle.ocx regsvr32 /s lmrt.dll regsvr32 /s datime.dll regsvr32 /s dxtrans.dll regsvr32 /s dxtmsft.dll regsvr32 /s wshom.ocx regsvr32 /s wshext.dll regsvr32 /s vbscript.dll regsvr32 /s scrrun.dll mstinit.exe /setup regsvr32 /s msnsspc.dll /SspcCreateSspiReg regsvr32 /s msapsspc.dll /SspcCreateSspiReg echo. echo. echo 修复成功!任意键退出! pause>nul