Skip to content

Loading…

Added browser detection to exports (Chomre, FF, Safari) - resolve #849 #850

Closed
wants to merge 1 commit into from

2 participants

@Matt-Allen44

No description provided.

@gorhill

That's not how it works. I haven't decided if this feature make sense, if it is really needed.

@gorhill gorhill closed this
@dungsaga dungsaga pushed a commit that referenced this pull request
@gorhill gorhill this addresses #850 71b967f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/js/settings.js
View
18 src/js/settings.js
@@ -39,7 +39,7 @@ var exportToFile = function() {
return;
}
var now = new Date();
- var filename = vAPI.i18n('aboutBackupFilename')
+ var filename = getBrowser() + vAPI.i18n('aboutBackupFilename')
.replace('{{datetime}}', now.toLocaleString())
.replace(/ +/g, '_');
vAPI.download({
@@ -51,6 +51,22 @@ var exportToFile = function() {
messager.send({ what: 'getUserData' }, onUserDataReady);
};
+var getBrowser = function(){
+ var userAgent = navigator.userAgent;
+
+ if(userAgent.indexOf("Chrome") > -1){
+ return "(Google Chrome) ";
+ }
+ if(userAgent.indexOf("Safari") > -1){
+ return "(Apple Safari) ";
+ }
+ if(userAgent.indexOf("Firefox") > -1){
+ return "(Mozilla Firefox) ";
+ }
+
+ return "";
+}
+
/******************************************************************************/
var handleImportFilePicker = function() {
Something went wrong with that request. Please try again.