IPad not supporting target ="_self" - javascript

I am trying to use Skype for business URIs to open on an IPad from safari browser. But whenever I click on link its not showing popup for opening Skype for business app. It's working fine for chrome and other browsers on IPad, but not for safari. Here is the code for it:
<!DOCTYPE html>
<html>
<head>
<script>
function myfunction() {
window.open("sip:","_self")
}
</script>
</head>
<body>
IM for desktop
</body>
</html>

Related

Kinvey not working on iPhone and iPad

I'm using Kinvey's backend services accessing by their Javascript API. Initialisation of Kinvey works fine in any PC browser (Safari, FF, Chrome) and also on FF mobile and Chrome mobile. I got this error on iPhone's Safari and iPad's Safari only, console output:
jQuery.Deferred exception: Can't find variable: Kinvey
https://.html:22:15
l#https://code.jquery.com/jquery-3.3.1.min.js:2:29380
https://code.jquery.com/jquery-3.3.1.min.js:2:29678
Here's the code showing the error:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My App</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://da189i1jfloii.cloudfront.net/js/kinvey-html5-sdk-3.11.1.min.js"></script>
<script src="https://matthewcv.github.io/mobiledebug.js"></script>
</head>
<script>
$(document).ready(function() {
console.log("before");
// Init Kinvey
Kinvey.init({
appKey: '<yourAppKey>',
appSecret: '<yourAppSecret>'
});
console.log("after");
});
</script>
<body>
<div>
Show something
</div>
</body>
</html>
I'm working with the latest iOS as well as the latest Javascript packages.
I wrote several times into Kinvey's forum but nobody seems to care of. So I try it here in hope someone knows the solution.
Based on remotesynth's comment I was sure that something screwed up my iPhone. After a complete reset of the device I could make it working too.

Speech Synthesis API isn't working in mobile browsers

I'm trying to use the SpeechSynthesis API for my website, but it turns out that the same code that works on a desktop browser, doesn't work on a mobile browser.
<!DOCTYPE html>
<html>
<head>
<title>prueba</title>
</head>
<body>
<button onclick="play()">Play</button>
<script>
function play() {
if ('speechSynthesis' in window) {
console.log("The API is installed");
var ssu = new SpeechSynthesisUtterance("hello world");
window.speechSynthesis.speak(ssu);
}
}
</script>
</body>
</html>
I have tested it on a Huawei P10 with Chrome, iPhone X with Safari, and a Moto G5 with Chrome. None of these work. Does it work on your phones? Do you know how to fix it? Thank you.
UPDATE:
After deleting the history and cleaning cache, it works on Android devices. But it still doesn't work on iPhones (I've tested it on Iphone X and Iphone 6, before and after deleting the history and cache).

instagram.com mobile version frome iframe

i try to access the mobile version of instagram frome iframe using chrome browser on desktop, i tryed change user agent of browser, when i access instagram.com from chrome i get the mobile version of instagram, but from my iframe i get the desktop version.
the code of ifram page is :
<html>
<head>
</head>
<body>
<iframe src="https://www.instagram.com" width="288" height="466" frameborder="0"></iframe<
</body>
</html>

Why is javascript not executing on a web page when accessed via iOS Twitter browser?

I am completely stumped and I'm sure this was working before.
I have a simple web page with the word "hello" in a div which does two things onload:
1) alert "2"
2) change the text of the div to "bye"
All vanilla Javascript, no libraries.
This works fine on the Chrome, IE, FF, Safari (as you'd expect). If I hit a link in the iOS Twitter app (latest version) to this web page neither of those two things happen. It seems to me that the Javascript is not being executed at all but how can this be? Has anyone else experienced this?
UPDATE
In fact vanilla Javascript will work. The alert test was misleading - I believe thats been disabled which is why it won't work. JQuery will not work however - possibly to do with the $ reference conflicting.
UPDATE 2
The problem has moved on now - my initial assumptions were not entirely correct.
The following code for a web page works:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<style>
#test {
color:red;
}
</style>
<script>
window.onload = function () {
document.getElementById('test').innerHTML = 'vanilla javascript worked';
$("#test").text("Jquery worked");
}
</script>
</head>
<body>
<div id="test">
hello
</div>
</body>
</html>
The following code does not work. The path to my script is sound and works on normal browsers, but when in the iOS Twitter in-app browser it seems the local script will not load:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title></title>
<script src="~/Scripts/jquery-2.1.1.js" type="text/javascript"></script>
<style>
#test {
color:red;
}
</style>
<script>
window.onload = function () {
document.getElementById('test').innerHTML = 'vanilla javascript worked';
$("#test").text("Jquery worked");
}
</script>
</head>
<body>
<div id="test">
hello
</div>
</body>
</html>
I have tested the issue on accessing the webpage via Facebook which also works fine either way. The problem is with the Twitter browser only on iOS.
I have tried using an absolute path to my script which also does not work.
UPDATE
This issue is not on iPad. It is iPhone only. As it was working before fine I'd say this is a bug from the latest release of the iPhone Twitter app. Will wait for a fix from Twitter.
Turned out to be that I was re-writing all requests from Twitter to a pre-rendered html instance (brombone). So when it was looking for that file it was actually looking at the brombone server not mine. I took out the rewrite and its fine now.
Completely unrelated to what I was going on about but I solved it nonetheless and may be a reminder to those with similar problems to look outside of the box and check server setups etc...

Play sound on Safari (iOS) and Chrome (Android) using JavaScript

I want to be able to play sound on HTML page using JavaScript when some event happens.
Basically I want to get data from server using AJAX and then if it is something specific, then play sound.
It works great on PC browsers, but I have issues making it work on Safari (iOS) and Chrome (Android). I read that to play sound on Chrome (I guess Safari also), this needs to be triggered by some user event (gesture, click, etc.). So here is my SIMPLIFIED code:
<!DOCTYPE HTML>
<head>
<meta http-equiv="refresh" content="7" />
</head>
<body>
<button onclick="playSound()" id="button">Click me</button>
<script>
window.setInterval(function(){
parent.document.getElementById('button').click();
}, 5000);
function playSound() {
var audio = new Audio('http://www.soundjay.com/button/beep-01a.wav');
audio.play();
}
</script>
</body>
</html>
I thought this workaround will work (trigger click event using JS), but still no sound.
One additional thing is that I want to AJAX code every few seconds and even when phone is BLOCKED. I found this solution (and applied my changes from previous try):
background.html:
<!DOCTYPE HTML>
<head>
<meta http-equiv="refresh" content="3" />
</head>
<body>
<script>
parent.run_function_from_core_page();
</script>
</body>
</html>
In index.html:
<iframe src="background.html" style="display:none;"></iframe>
But again, works great on PC, but no sound on either Chrome mobile and Safari mobile.
Any suggestions? Is that even possible?

Categories