|
@@ -257,34 +257,22 @@
|
|
|
|
|
|
</body>
|
|
</body>
|
|
|
|
|
|
-<!-- <script>
|
|
|
|
- console.log(111111111111)
|
|
|
|
- // var href = "http://www.baidu.com"
|
|
|
|
- var href = "http://localhost:3000"
|
|
|
|
- // 1.
|
|
|
|
- // avueData()
|
|
|
|
- // function avueData() {
|
|
|
|
- // console.log(11123686)
|
|
|
|
-
|
|
|
|
- // if (window.ActiveXObject === undefined) {// 不是ie浏览器,可直接打开
|
|
|
|
- // window.open(href, '_blank');
|
|
|
|
- // } else {// 是ie浏览器,跳转打开chrome
|
|
|
|
- // var objShell = new ActiveXObject("WScript.Shell");
|
|
|
|
- // objShell.Run("cmd.exe /c start chrome " + href, 0, true);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
|
|
+<script>
|
|
|
|
+ // console.log(111111111111)
|
|
|
|
+ // var href = "http://localhost:3000"
|
|
|
|
+ var href = "http://10.67.0.64:9988"
|
|
|
|
|
|
- // 2.
|
|
|
|
|
|
+ // 1.
|
|
window.onload = function () {
|
|
window.onload = function () {
|
|
var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase());
|
|
var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase());
|
|
// 判断是否谷歌浏览器
|
|
// 判断是否谷歌浏览器
|
|
if (!is_chrome) {
|
|
if (!is_chrome) {
|
|
console.log(!is_chrome)
|
|
console.log(!is_chrome)
|
|
console.log('1',href)
|
|
console.log('1',href)
|
|
- // setTimeout(toGG(href), 100);
|
|
|
|
|
|
+ setTimeout(toGG(href), 100);
|
|
} else {
|
|
} else {
|
|
- console.log('2',href)
|
|
|
|
- // window.location.replace(href)
|
|
|
|
|
|
+ console.log('谷歌',href)
|
|
|
|
+ // window.location.replace(href) // 此代码会有重复进入的bug
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function toGG(url) {
|
|
function toGG(url) {
|
|
@@ -303,8 +291,10 @@
|
|
cmd.exe /k start dir 会打开一个新窗口后执行dir指令,原窗口不会关闭。
|
|
cmd.exe /k start dir 会打开一个新窗口后执行dir指令,原窗口不会关闭。
|
|
这里的dir是start chrome www.baidu.com//用谷歌浏览器打开百度
|
|
这里的dir是start chrome www.baidu.com//用谷歌浏览器打开百度
|
|
*/
|
|
*/
|
|
- console.log(url)
|
|
|
|
- objShell.Run("cmd.exe /c start chrome " + url, 0, true);
|
|
|
|
|
|
+ // console.log(url)
|
|
|
|
+ // console.log(objShell)
|
|
|
|
+ objShell.Run("cmd.exe /c start chrome " + url, 0, false);
|
|
|
|
+ // console.log(':',objShell.Run("cmd.exe /c start chrome " + url, 0, false))
|
|
}
|
|
}
|
|
function getChromePath(objShell) {
|
|
function getChromePath(objShell) {
|
|
var regPath = ["HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Google Chrome\\InstallLocation",
|
|
var regPath = ["HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Google Chrome\\InstallLocation",
|
|
@@ -327,6 +317,19 @@
|
|
return undefined;
|
|
return undefined;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ // 2.
|
|
|
|
+ // avueData()
|
|
|
|
+ // function avueData() {
|
|
|
|
+ // console.log(11123686)
|
|
|
|
+
|
|
|
|
+ // if (window.ActiveXObject === undefined) {// 不是ie浏览器,可直接打开
|
|
|
|
+ // window.open(href, '_blank');
|
|
|
|
+ // } else {// 是ie浏览器,跳转打开chrome
|
|
|
|
+ // var objShell = new ActiveXObject("WScript.Shell");
|
|
|
|
+ // objShell.Run("cmd.exe /c start chrome " + href, 0, true);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
// 3.
|
|
// 3.
|
|
// var objShell = new ActiveXObject("WScript.Shell");
|
|
// var objShell = new ActiveXObject("WScript.Shell");
|
|
|
|
|
|
@@ -345,6 +348,6 @@
|
|
|
|
|
|
// redirectToGoogle();
|
|
// redirectToGoogle();
|
|
|
|
|
|
-</script> -->
|
|
|
|
|
|
+</script>
|
|
|
|
|
|
</html>
|
|
</html>
|