2
0
Эх сурвалжийг харах

Merge pull request #517 from smiclea/fix-safari-wizard-password

Fix Safari password save prompt issue in Wizard
Nashwan Azhari 6 жил өмнө
parent
commit
a2ca40f82a

+ 3 - 1
src/sources/WizardSource.js

@@ -19,6 +19,8 @@ import notificationStore from '../stores/NotificationStore'
 import { OptionsSchemaPlugin } from '../plugins/endpoint'
 import { OptionsSchemaPlugin } from '../plugins/endpoint'
 
 
 import { servicesUrl } from '../constants'
 import { servicesUrl } from '../constants'
+import DomUtils from '../utils/DomUtils'
+
 import type { WizardData } from '../types/WizardData'
 import type { WizardData } from '../types/WizardData'
 import type { StorageMap } from '../types/Endpoint'
 import type { StorageMap } from '../types/Endpoint'
 import type { MainItem } from '../types/MainItem'
 import type { MainItem } from '../types/MainItem'
@@ -95,7 +97,7 @@ class WizardSource {
 
 
   setUrlState(data: any) {
   setUrlState(data: any) {
     let locationExp = /.*?(?:\?|$)/.exec(window.location.href)
     let locationExp = /.*?(?:\?|$)/.exec(window.location.href)
-    if (!locationExp) {
+    if (!locationExp || DomUtils.isSafari()) {
       return
       return
     }
     }
     let location = locationExp[0].replace('?', '')
     let location = locationExp[0].replace('?', '')

+ 4 - 0
src/utils/DomUtils.js

@@ -150,6 +150,10 @@ class DomUtils {
       return `<span class="${cls}">${match}</span>`
       return `<span class="${cls}">${match}</span>`
     })
     })
   }
   }
+
+  static isSafari() {
+    return navigator.userAgent.indexOf('Chrome') === -1 && navigator.userAgent.indexOf('Safari') > -1
+  }
 }
 }
 
 
 export default DomUtils
 export default DomUtils