Skip to content

Commit d40d890

Browse files
committed
fix: Cordova platform wrongfully detected if served over HTTPS quasarframework#1678
1 parent d71be2d commit d40d890

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/plugins/platform.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,16 @@ function getPlatform () {
149149
browser.name = matched.browser
150150
browser.platform = matched.platform
151151

152-
if (window && window.process && window.process.versions && window.process.versions.electron) {
153-
browser.electron = true
154-
}
155-
else if (document.location.href.indexOf('chrome-extension://') === 0) {
156-
browser.chromeExt = true
157-
}
158-
else if (
159-
window._cordovaNative ||
160-
window.cordova ||
161-
document.location.href.indexOf('http://') === -1
162-
) {
163-
browser.cordova = true
152+
if (!isSSR) {
153+
if (window.process && window.process.versions && window.process.versions.electron) {
154+
browser.electron = true
155+
}
156+
else if (document.location.href.indexOf('chrome-extension://') === 0) {
157+
browser.chromeExt = true
158+
}
159+
else if (window._cordovaNative || window.cordova) {
160+
browser.cordova = true
161+
}
164162
}
165163

166164
return browser

0 commit comments

Comments
 (0)