mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-12 22:22:31 +01:00
added 'browser' to survey url. fixes #657
This commit is contained in:
parent
f3d77fdcf2
commit
7fb11ba912
@ -12,6 +12,31 @@ const assets = require('../../common/assets');
|
|||||||
*/
|
*/
|
||||||
const version = require('../../package.json').version || 'VERSION';
|
const version = require('../../package.json').version || 'VERSION';
|
||||||
|
|
||||||
|
function browserName() {
|
||||||
|
try {
|
||||||
|
if (/firefox/i.test(navigator.userAgent)) {
|
||||||
|
return 'firefox';
|
||||||
|
}
|
||||||
|
if (/edge/i.test(navigator.userAgent)) {
|
||||||
|
return 'edge';
|
||||||
|
}
|
||||||
|
if (/trident/i.test(navigator.userAgent)) {
|
||||||
|
return 'ie';
|
||||||
|
}
|
||||||
|
if (/chrome/i.test(navigator.userAgent)) {
|
||||||
|
return 'chrome';
|
||||||
|
}
|
||||||
|
if (/safari/i.test(navigator.userAgent)) {
|
||||||
|
return 'safari';
|
||||||
|
}
|
||||||
|
return 'other';
|
||||||
|
} catch (e) {
|
||||||
|
return 'unknown';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const browser = browserName();
|
||||||
|
|
||||||
module.exports = function(state) {
|
module.exports = function(state) {
|
||||||
return html`<header class="header">
|
return html`<header class="header">
|
||||||
<div class="send-logo">
|
<div class="send-logo">
|
||||||
@ -25,7 +50,7 @@ module.exports = function(state) {
|
|||||||
<div>${state.translate('siteSubtitle')}</div>
|
<div>${state.translate('siteSubtitle')}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="https://qsurvey.mozilla.com/s3/txp-firefox-send?ver=${version}"
|
<a href="https://qsurvey.mozilla.com/s3/txp-firefox-send?ver=${version}&browser=${browser}"
|
||||||
rel="noreferrer noopener"
|
rel="noreferrer noopener"
|
||||||
class="feedback"
|
class="feedback"
|
||||||
target="_blank">${state.translate('siteFeedback')}</a>
|
target="_blank">${state.translate('siteFeedback')}</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user