|
48 | 48 | } |
49 | 49 | msieversion(); |
50 | 50 |
|
51 | | - function openURL(e) { |
52 | | - browser = e.getAttribute('value'); |
53 | | - if (browser == 'microsoft-edge') { |
54 | | - //edge can not be opened via shell |
55 | | - window.open((browser = e.getAttribute('value') + ':' + window.location.href)); |
56 | | - } else { |
57 | | - new ActiveXObject('WScript.Shell').run(browser + ' ' + window.location.href); |
58 | | - } |
59 | | - } |
60 | | - |
61 | 51 | function msieversion() { |
62 | 52 | var browserList = { |
63 | | - //list of browser-links where app can be openend in: key=browser name, value=shell-command to open browser |
64 | | - 'Microsoft Edge': 'microsoft-edge', |
65 | | - 'Google Chrome': 'chrome', |
66 | | - 'Mozilla Firefox': 'firefox', |
67 | | - Opera: 'opera' |
| 53 | + //list of browser-links where app can be openend in: key=browser name, value=link for browser download |
| 54 | + 'Google Chrome': 'https://www.google.de/chrome/', |
| 55 | + 'Mozilla Firefox': 'https://www.mozilla.org', |
| 56 | + Opera: 'https://www.opera.com' |
68 | 57 | }; |
69 | 58 | var ua = window.navigator.userAgent; |
70 | 59 | var msie = ua.indexOf('MSIE '); |
71 | 60 |
|
72 | 61 | if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { |
73 | 62 | // stone age browser IE |
74 | 63 | var html = |
75 | | - '<div class="pb-no-ie"><p><strong>This application does not support Internet Explorer!</strong></p><p>To run the Phonebook, please use one of the following modern browsers:</p><ul>'; |
| 64 | + '<div class="pb-no-ie"><h1>This application does not support Internet Explorer!</h1><p>To run the Phonebook, please <a href="microsoft-edge:' + |
| 65 | + window.location.href + |
| 66 | + '">open it in Microsoft Edge</a></strong> or use one of the following modern browsers:</p><ul><strong>'; |
76 | 67 | for (var key in browserList) { |
77 | | - html += '<li onclick="openURL(this)" value="' + browserList[key] + '"><strong>' + key + '</strong></li>'; |
| 68 | + html += '<li><strong><a href="' + browserList[key] + '" target="_blank">' + key + '</a></strong></li>'; |
78 | 69 | } |
79 | | - html += '</ul><p>If this was detected by mistake consider <a href="https://github.com/T-Systems-MMS/phonebook/issues/new/choose">opening an issue</a>.</p> </div>'; |
| 70 | + html += |
| 71 | + '</ul><p>If this was detected by mistake consider <a href="https://github.com/T-Systems-MMS/phonebook/issues/new/choose">opening an issue</a>.</p> </div>'; |
80 | 72 |
|
81 | 73 | document.getElementsByTagName('body')[0].innerHTML = html; |
82 | 74 | } |
|
0 commit comments