Detect closing of mobile Safari - webkit

I'm building a WebApp which uses video server push with:
<img id="vidsrc" src="video.cgi"/>
It works. And when saved as a WebApp using "Add to Home Screen" closing the app does as expected and stop receiving the server push.
However when running in mobile Safari, only closing the page will get it to stop. What I'm trying to figure out is how to get it to stop if the user clicks the Home button and closes mobile Safari so the push doesn't keep running in the background.
Because of what I've got to work with, editing video.cgi is not an option. And using video.cgi in an iframe isn't a good solution because of some other functionality in the page/app.
onBlur and onClose don't seem to do it, and I'm wondering if there's any way an HTML page or the good stuff in it can know that mobile Safari has been closed.

Unfortunately, you can't... Web apps are not allowed to access the device's software, so are not told when you have pressed the button.

Related

React Native - Branch link in an Intercom message opens browser first instead of the app

I'm finding it hard to get Branch.io deeplinking to work with Intercom.
The Branch link works well when opened via native Messages app - opens the app directly when tapped.
But if we send this link through an Intercom message, and then tap on it on the phone, the result is not as expected:
On iOS
Open Intercom messages view.
Tap on the Branch link (sent from Intercom console).
Browser opens with an alert asking to open the native app ('Open this page in "MyApp"?').
Press "Open".
App detects the Branch parameters on the link and redirects to the correct page.
Expected Behavior
App should detect the link directly without being handed over by browser.
On Android
Open Intercom messages view.
Tap on the Branch link (sent from Intercom console).
List of suggested apps pops up - including "MyApp".
Tap on "MyApp".
App detects the Branch link ONLY, but without the parameters - which then will not redirect to any page.
Now send the app to the background (eg: Tap on home button), and then open "MyApp" again.
Branch will now detect the link with the parameters and redirect to the correct page (this sometimes happens in iOS as well).
Expected Behavior
Branch should detect the link with parameters directly, without the need to send the app to background and reopen.
Does anyone have an idea what I have missed out on? or a workaround?
I was thinking to setup Universal Links by uploading the Association File.. 🤷‍♂️
Btw, Branch.io configurations are all done and works perfectly with other social media apps.
react-native: 0.61.5
react-native-branch: 5.0.0-beta.1
react-native-intercom: 16.0.0

Whatsapp share link does not work in safari

I'm using this approach: https://stackoverflow.com/a/25796908/3437433
It works like a charm, but when I'm trying to use it in Safari (both desktop and mobile), then quite strange things happen.
On desktop, origin link https://wa.me/?text=123 is somehow replaced with whatsapp://send?text=123. And then Safari displays error page about wrong protocol.
On mobile, correct page is opened by origin link, but also alert appears saying "can't open page because url is wrong". I can close that alert, can click on "send" button, but then https://whatsapp.com/download/ page is opened, instead of prompting to login to whatsapp and redirecting to chat.
Does anybody know what's going on here and whether it can be fixed?
We usually differ link at desktop view and mobile view to offer support for safari and other browser.
for desktop view we use
https://web.whatsapp.com/send?phone=6200000000&text=Hello%20Moxqitto
for mobile, we follow whatsapp best practice https://faq.whatsapp.com/en/android/26000030/
https://wa.me/6200000000
Tested on
Chrome for mac
safari for mac
android chrome
Ps: not tested when mac have whatsapp desktop app, but it will still work in the safari itself. so it should be ok
Official Sharing Documentation For WhatsApp. They say to use their wa.me/... URL. Okay! So let's try it out! http://wa.me/?text=mytest For me, I get an error message...
PAGE NOT FOUND
However, these seem to work great for me!
https://api.whatsapp.com/send?text=YourShareTextHere
https://api.whatsapp.com/send?text=YourShareTextHere&phone=123
If you are interested in watching a project that keeps track of these URLs, then check us out!: https://github.com/bradvin/social-share-urls#whatsapp

VB.NET Web Browser Youtube full screen not working

I have been working on a simulation of windows 11, and it works, pretty well, but I added a web browser so you can browse the web and whenever i clicked on full screen mode on youtube, the video still shown, but the full screen part was all black.
This is the video fullscreen
Anyone have any idea how to fix this? I have been searching the web for it and I can't find anything.

windows authentication and iOS7

We are developing a web application in asp.net and HTML5 (+ offline feature) and we are using “Add to desktop” button to create the desktop application.
Before access main screen, we have a windows authentication screen, so people can connect using their domain credentials.
In safari, we have almost no problem. It's the expected behavior when we are online. For the offline mode, safari needs to keep an active tab with the website loaded to allow offline access to it, otherwise safari does not find website – even if it’s cached with cache manifest...
In the desktop application (using “Add to desktop” button), the authentication popup on the main page does not appears. When I trace the HTTP requests, I can see 2 requests with a return status of 401. When I look into the logs, safari sandbox throw an exception (twice tries then abort operation)... The screen remains blank.
any ideas anyone or any fix is planned to correct this problem ?
Thanks in advance for any advices.
It's a problem with iOS 7. Windows Authentication only works in "Private Mode" or in another browser such as Chrome or Puffin. However, there isn't a workaround currently available to save an app to the home screen. Here's a thread on the Apple forums about this same issue:
https://discussions.apple.com/thread/5327078?start=60&tstart=0
The new iOS 7.03 fixes this issue.

How to pass Login With Google Process in Cocoa WebView

I am developing a cocoa app for Mac OSX. It's a basic browser application and I use webview component.
In the page I want to connect, there is standard Login with Google Account button in order to login with my existing Google Account. When I clicked on this button nothing happens.
The same functionality works properly when I visited the same page by using Safari or any other browser but there is no reaction on webview component.
I've checked the action behind the Google's login button and here is the JS code.
onclick="return Dialog.Login.loginWithGoogle(false, 'https://www.mywebsite.com/-/oauth2callback', 'https://www.mywebsite.com/')"
As a part of the standard oauth process the process also has many redirections after this URL is called and normally should be completed at my site's login screen as expected. However, webview doesn't handle this.
Please note that the web site I am trying to connect in my webview is not belong to me and I have no control on it.
I checked many solutions on the web for 2 days but nothing helped.
Any help/hint will be appreciated.