Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari browser detection #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Safari browser detection #158

wants to merge 1 commit into from

Conversation

aleswita
Copy link

Correct regex for Safari detection

navigator.userAgent return
Mozilla/5.0 (Macintosh; Intel Max OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15

@aleswita
Copy link
Author

@vojtech-dobes ping

@spernica
Copy link

spernica commented Sep 3, 2018

Prosím, nemůžete použít let ... of, protože není pořádně podporovaný - https://www.w3schools.com/js/js_let.asp

Úplně mi váš skript odstřelil javascript v IE <=11

Konkrétně řádek (hlásí Byl očekáván znak ';')
for (var pair of formData.entries()) {

Správně je podle mě:

		if (formData.entries && navigator.userAgent.match(/version\/11(\.[0-9]+)* safari/i)) {
			var entries = formData.entries();
			for (var i = 0; i < entries.length; i++) {
				var pair = entries[i];
				if (pair[1] instanceof File && pair[1].name === '' && pair[1].size === 0) {
					formData.delete(pair[0]);
				}
			}
		}

Ale nemám otestované safari. Pouze IE a chrome.

@Bezdekm
Copy link

Bezdekm commented Nov 7, 2018

@spernica some problem

@lukasojd
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants