Facebook 'Continue' button misplaced in Chrome Extension oauth popup - google-chrome-extension

I'm using chrome.identity.launchWebAuthFlow to start the login flow and when the user oauths with Facebook, the bottom 'Continue' button is partially out of the view. When the user has to enter an email and password for the first time, it's fine, but when Facebook asks only for the password the next time, the issue occurs. Also on the 'Forgotten you password?' page.
Since chrome.identity.launchWebAuthFlow doesn't allow to set size, and resizing the window manually moves the button, but at the same misplaced position, I see it as a clear sign that it's Facebook's code or the chrome.identity.launchWebAuthFlow's window's quirk.
When opening up the same auth url in a real browser window, the button is placed at the right place.
Anyone else came across this issue? Is there any good workaround?

Related

Redirect to login page on commandButton press if session is invalid

Brief: How can i redirect to the login page when commandButton is pressed and the user is not logged in anymore?
In detail:
I am trying to solve the following scenario in my primefaces application:
I successfully log in in my web application
I open a new tab while logged in.
Now i log out from the second tab that i opened on step 2. In this tab i get redirected to the login page
Press a commandButton from the 1st tab that still looks like if the
user logged in but not many things happen .
When trying to access a page through a link while logged out, then yes i am redirected to the login page. The same does not happen though with the commandButton component.
I am using a filter already and tried to catch that case, meaning to confirm if on button press the session is null to redirect me to login page.
As seen here: https://stackoverflow.com/a/1027592/1918516
The problem is that even though i logged out from the 2nd tab, and press a button from the 1st tab, my session is never null.
Update: After logging out and invalidate the session with invalidateSession() i see that my session is null. But when press on a button from the first tab, the session is NOT null. Could this be that the browsers cache is somehow maintaining an invalid session ?
Also i want to note here that i am retrieving the session with request.getSession(false)

Chrome extension: show browser action popup only in some cases

I have a chrome extension. When the user clicks the icon I want to:
Check if the user is logged in. This uses google storage (I've got this code already).
If user is logged in, there should NOT be a popup.
If user is not logged in, show browser action pop-up with login post/ajax form.
Google says "If a browser action has a popup, the popup appears when the user clicks the icon." https://developer.chrome.com/extensions/browserAction.html
So I guess not? I could instead add a form to the page DOM, but I'd rather not do that. Any other nice solutions?
Use chrome.browserAction.setPopup({ popup: ''}) to remove the popup.
From the browserAction.setPopup docs:
Sets the html document to be opened as a popup when the user clicks on the browser action's icon...
popup ( string ): If set to the empty string (''), no popup is shown.
You can use chrome.browserAction.setPopup to specify a popup page to show, or no popup at all. However, you must specify the popup before the user clicks the browser action; I don't believe you can change it "just in time" as the user clicks. You should simply start with the popup active by default, and then turn it off once the user has successfully logged in.

facebook login view does not have any option to close it

I'm facing a strange problem here, i have used a sample code of graph api's (reallylongaddress-iPhone-Facebook-Graph-API-59e6399, Created by , https://github.com/reallylongaddress/iPhone-Facebook-Graph-API) which was available on github. And i faced these problems:-
1) I'm having a share button of my own , when i click on it to login to fb a white view (or popup ) apears for almost 5 seconds and it appears evry time when i click on share button to share something on my facebook wall, even if i'm logged in . I reduced this problem to only one time.
2) The second and main problem now i'm facing is that on login it doesn't have any close button on it , and user must have to login ,other wise the application will not continue. Can i place a close button on this fb login web view?
NOTE:I have also used the fbconnect earlier but i dont wanna use publish dialog box ,, which shows user a dialog box and then user can press on "pulish" or "skip" button. instead i want that what ever the user wants to share on wall can be shared on just one tap on a button. That is why i have used this sample code, but it also has these two problems i have specified above.
Please help me with these 2 problems above or suggest me any other alternative option which does not have the "publish.stream" dialog box.
Thanks
In this condition Facebook controller are called by UINavigationController.
Finally i solved the problem and placed a close button on the login view. and on tab of this button i closed the login web view

Browser navigation, back button issue

I want to know how you guys deal with back button issues in your web applications.
I can not forbid users to click back button on their browser, but when they hit it, the page code doesn't run. So writing in page_load() makes no sense.
I have searched online and found this link: Disabling Back button on the browser. It does not work for me. Any idea?
There is no way to disable the back button. You can try to open your page/form in a new window so there would be nothing to navigate back to
Normally, If I have a critical or lengthy form, I tend to maintain a dirty-flag and if the user starts entering something, the dirty-flag gets set and on save or submit it gets reset. You can use unload/beforeunload javascript event to see if the dirty-flag is set and ask for confirmation.

UIWebview Facebook Connect

Inside a UIWebView the user can click on FB connect button the page displays and when I hit login the UIWebView turns blank and stops there.
On a regular browser after the login is hit, it looks like it goes on fb and redirects back to the webite. I'm not sure what to change on the UIWebView so that it handles it like Safari does
edit:So when I try it on the simulator's safari, hitting the FB Connect button, it opens a new page that shows the login form and then it closes and goes back to the first page after hitting login. SO i guess the question: Is there a way for UIwebView to handle this?
The real problem was using the regular facebook login as opposed to the m.facebook.com login.
Which avoids creating a pop up.

Resources