Skip to content

Commit 65b2317

Browse files
authored
fix: windows x86 vs x64 cannot be detected
Signed-off-by: Steven <steven@ceriously.com>
1 parent f046da5 commit 65b2317

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

static/js/main.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@
113113
var userAgent = navigator.userAgent;
114114
var osMatch = userAgent.match(/(Win|Mac|Linux)/);
115115
var os = (osMatch && osMatch[1]) || '';
116-
var arch =
117-
userAgent.match(/x86_64|Win64|WOW64/) || navigator.cpuClass === 'x64'
118-
? 'x64'
119-
: 'x86';
120116
var buttons = document.querySelectorAll('.home-downloadbutton');
121117
var downloadHead = document.querySelector('#home-downloadhead');
122118
var dlLocal;
@@ -141,21 +137,13 @@
141137
downloadHead.textContent = dlLocal + ' macOS';
142138
break;
143139
case 'Win':
144-
versionIntoHref(buttons, 'node-%version%-' + arch + '.msi');
145-
downloadHead.textContent = dlLocal + ' Windows (' + arch + ')';
140+
versionIntoHref(buttons, 'node-%version%-x64.msi');
141+
downloadHead.textContent = dlLocal + ' Windows (x64)';
146142
break;
147143
case 'Linux':
148144
versionIntoHref(buttons, 'node-%version%-linux-x64.tar.xz');
149145
downloadHead.textContent = dlLocal + ' Linux (x64)';
150146
break;
151147
}
152148
}
153-
154-
// Windows button on download page
155-
var winButton = document.querySelector('#windows-downloadbutton');
156-
if (winButton && os === 'Win') {
157-
var winText = winButton.querySelector('p');
158-
winButton.href = winButton.href.replace(/x(86|64)/, arch);
159-
winText.textContent = winText.textContent.replace(/x(86|64)/, arch);
160-
}
161149
})();

0 commit comments

Comments
 (0)