Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27150
| From | Richard Maher <maher_rjSPAMLESS@hotmail.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Forced to browser-sniff Safari version |
| Date | 2015-04-01 16:49 +0800 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <mfgbeg$otv$1@speranza.aioe.org> (permalink) |
Can someone tell me the "best" way to detect Safari and then its version
number?
Look, I don't want to do it but I can't find a way to pin down a WORKING
version of speechSynthesis on Safari :-(
See below for an example that works on iOS 7.1.2 *IF* you don't add the
onEnd listener. Apart from that everything is peachy.
In my real world full blown example it talks but still won't deliver the
at end event.
On iOS 8 there is no issue. (I'm assuming here Safari versions are tied
to the OS?)
Please offer a best-of-breed agent sniffer or a better
working-feature-detector.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function fini()
{
alert("end");
}
function talk()
{
if (!('speechSynthesis' in window)) {
alert("Unsupported browser");
return;
}
alert("Getting ready.");
var utterance = "Hello World";
var chat = new SpeechSynthesisUtterance(utterance);
chat.addEventListener('end', fini, false);
speechSynthesis.speak(chat);
}
</script>
</head>
<body>
<p>On Safari this example won't fire any known events<br />
onend, onerror, even onended: -</p>
<input type="button" value="Talk" onclick="talk()" />
<br /><br />
No probs on Chrome or Opera. Spewin!
</body>
</html>
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-01 16:49 +0800
Re: Forced to browser-sniff Safari version JJ <jj4public@vfemail.net> - 2015-04-01 19:19 +0700
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-01 20:35 +0800
Re: Forced to browser-sniff Safari version Denis McMahon <denismfmcmahon@gmail.com> - 2015-04-01 14:50 +0000
Re: Forced to browser-sniff Safari version Scott Sauyet <scott.sauyet@gmail.com> - 2015-04-01 09:35 -0700
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 06:29 +0800
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 06:28 +0800
Re: Forced to browser-sniff Safari version "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-02 01:04 +0200
Re: Forced to browser-sniff Safari version Andrew Poulos <ap_prog@hotmail.com> - 2015-04-02 10:53 +1100
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 09:18 +0800
Re: Forced to browser-sniff Safari version Andrew Poulos <ap_prog@hotmail.com> - 2015-04-02 15:12 +1100
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 10:25 +0800
Re: Forced to browser-sniff Safari version Andrew Poulos <ap_prog@hotmail.com> - 2015-04-02 18:44 +1100
Re: Forced to browser-sniff Safari version "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-04-01 17:59 -0700
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 10:20 +0800
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 20:27 +0800
Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 21:06 +0800
Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 21:55 +0800
Re: Opera mobile has laryngitis "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-04-02 16:28 -0700
Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 07:38 +0800
Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 07:56 +0800
Re: Opera mobile has laryngitis Swifty <steve.j.swift@gmail.com> - 2015-04-04 07:47 +0100
Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-05 08:12 +0800
Re: Opera mobile has laryngitis Ed Jay <edMbj@aes-intl.com> - 2015-04-05 08:59 -0700
Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-06 06:56 +0800
Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 10:02 +0800
Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 08:14 +0800
Re: Opera mobile has laryngitis Wally W. <ww84wa@aim.com> - 2015-04-04 12:49 -0400
Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-05 08:18 +0800
csiph-web