Skip to content

Commit 6227bd7

Browse files
committed
fix(no-ie): remove AxtiveX elements
add download links for modern browsers
1 parent f12f03a commit 6227bd7

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

Phonebook.Frontend/src/index.html

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,27 @@
4848
}
4949
msieversion();
5050

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-
6151
function msieversion() {
6252
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'
6857
};
6958
var ua = window.navigator.userAgent;
7059
var msie = ua.indexOf('MSIE ');
7160

7261
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
7362
// stone age browser IE
7463
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>';
7667
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>';
7869
}
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>';
8072

8173
document.getElementsByTagName('body')[0].innerHTML = html;
8274
}

Phonebook.Frontend/src/styles.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ app-root {
186186
left: 38%;
187187
position: absolute;
188188
}
189-
.pb-no-ie li {
189+
.pb-no-ie a {
190190
cursor: pointer;
191+
text-decoration: none;
191192
&:hover {
192193
color: #9b9e9e;
193194
}

0 commit comments

Comments
 (0)