How to close the iOS Captive Network Assistant Popup with Javascript - javascript

Problem: Captive Network Assistant on Apple devices is bring up the CNA screen with only a cancel button. Is there a way to close this window and/or redirect to safari by clicking on a link/javascript?
Background Info: Upon connecting to a wifi access point, users are redirected to a splash page. This splash page has links with target _blank to open in a new tab. The CNA login dialog breaks this functionality. Ideally, users would be prompted the CNA login, they would click continue, and it would load our splash page in safari and close the login dialog. Any information on how to do this would be much appreciated. Thanks!

Related

How to deep link to an app without asking user?

There is a website called url genius.
How it works: you choose Instagram for example, you write your profile link, and then it creates a deep link, when you click on it either you're on iPhone or Android, it open directly the app WITHOUT ASKING "DO YOU WANT TO OPEN THIS LINK IN THE APP"
I tried to replicate this with some JS, my code first detect which device the user is on, then :
if the user is on Android it redirects with a window.location.replace to intent://www.instagram.com/profile/#Intent;package=com.instagram.android;scheme=https;end
if the user is on iPhone it redirects with a window.location.replace to instagram://user?username=profile
MY PROBLEM:
The link doesn't open directly in the app, it first asks to the user "do you want to open the link Instagram app". So how does URL Genius manage to redirect directly the user?

Close all browser tabs from specific site

When a user logs out on my website I want to close all browser tabs of my website. Is that possible to do?
browser tabs

Facebook authentication

I have an application which displays canvas page, even though the user clicks "Dont allow" button in a request dialog. Here is my issue:
Load the page http://174.123.24.242/fb_leagle/fbhome.aspx
Login my application through facebook login page of my application.
Click on "Dont Allow" button in a request permission dialog.
In issue #3, if he clicks "Dont Allow" button it will also display the canvas page, and when I click the "BACK BUTTON" of the browser the next dialog appears. Actually I need to skip the canvas page from displaying when user clicks "Don't Allow" button and redirects to the next dialog.
This is my login URL of my application: pls review it and guide me where i need to change it.
Blockquote
**https://www.facebook.com/login.php?api_key=************&skip_api_login=1&display=page&cancel_url=https%3A%2F%2Fapps.facebook.com%2Fleaglecases%2F%3Ferror_reason%3Duser_denied%26error%3Daccess_denied%26error_description%3DThe%2Buser%2Bdenied%2Byour%2Brequest.&next=http%3A%2F%2Fwww.facebook.com%2Fdialog%2Fpermissions.request%3F_path%3Dpermissions.request%26app_id%3D***************%26redirect_uri%3Dhttp%253A%252F%252Fapps.facebook.com%252Fleaglecases%252F%26display%3Dpage%26response_type%3Dcode%26canvas%3D1%26perms%3Dpublish_stream%252Cemail%26from_login%3D1&rcount=1**
pretty format of this url:
https://www.facebook.com/login.php?api_key=************
skip_api_login=1
display=page
cancel_url=https%3A%2F%2Fapps.facebook.com%2Fleaglecases%2F%3Ferror_reason%3Duser_denied%26error%3Daccess_denied%26error_description%3DThe%2Buser%2Bdenied%2Byour%2Brequest.
next=http%3A%2F%2Fwww.facebook.com%2Fdialog%2Fpermissions.request%3F_path%3Dpermissions.request%26app_id%3D***************%26redirect_uri%3Dhttp%253A%252F%252Fapps.facebook.com%252Fleaglecases%252F%26display%3Dpage%26response_type%3Dcode%26canvas%3D1%26perms%3Dpublish_stream%252Cemail%26from_login%3D1
rcount=1
According to the OAuth Dialog Documentation, the user will be redirected to the original app-page.
If the user clicks "Don't Allow", the browser will redirect to
http://www.example.com/response?error=access_denied&
error_description=The+user+denied+your+request.
I suggest you use the $_GET['error'] variable to recognize users that denied the request!
The different errors can be found here

Getting Facebook Authentication Dialog to redirect to the original browser window running my application

I'm really new to the Facebook API and am having trouble getting the Facebook authentication dialog to redirect to the original browser window of my application. Here's the current process via client-side flow:
User is logged into my application (Ruby on Rails Application with Javascript/Jquery scripting).
User clicks on button in my application to log into his/her Facebook account.
The Facebook Authentication Dialog pops up in a 2nd window, asking user to log in.
User logs into Facebook
The Facebook Authentication Dialog asks the user if he/she wants to grant my application permission.
User clicks ok to share profile information.
The Facebook Authentication Dialog redirects the 2nd window to also open an instance of my application with the access token in the URL.
My questions are the following:
How can I get Facebook Authentication Dialog window to close after the user successfully logs into his/her Facebook account?
How can I gain access to the Facebook Access token after closing the second window?
The best way to illustrate what I'm ultimately trying to do is when somebody is signing into ESPN's site (1st window). Notice, that a modal window (2nd window) opens where you can click "sign in" (upper right corner) on ESPN's site. In this modal window, you can sign in with your Facebook account. Clicking on the "Sign in with Facebook Account" link will open a 3rd window which will take you through the Facebook Authentication process. When finished with signing into Facebook, the 3rd window will close and the modal window is updated based on the status of the 3rd window that closed.
How can I get the Facebook Authentication Dialog window to close and redirect to a preceding window?
Thanks!
Here is what I did in a similar situation. For the facebook dialog, have it redirect to a page on your site then simply grabs the access token and whatever other data you need. (In my case I just sessionized some of the user info). In the output of that page, include some javascript in your document.ready that will close this second window, and redirect to whatever page you want in the first window. It looks somthing like this.
window.opener.location.href = '/redirect_url_for_first_window'; //set url of the main window
window.close(); //close the popup
You can use window.opener in a popup window to refer to the window it came from. You can even have your popup window access variables and call functions of the main window as well.
Hope this helps!

iPad Safari popup issue

I am using window.open to open a popup in my page...
Now the issue is the popup gets displayed only if the user has changed the settings to allow popups...
What is the fix if I want to show the popup whether or not the user has blocked/allowed it ?
If a user has blocked popups, your website will not be able to launch them.

Categories

Resources