I work on an jsp application where on main page we have left side menu and iframe to display content for the link selected. Only one link opens in a new tab and full page as it displays the details of application stacks and jobs running, much like a dashboard. We are using tomcat as servlet container. My problem is when session timed out from tomcat side login page is displayed but it gets displayed on both the tabs. My concern is, we want user to show only one login page for this we have use javascript code to know if the parent page is opened or not.
We have few scenarios :
If parent page is open, we close the child tab and open login page in parent windows. Works perfectly.
When parent window is closed, we open the login page in child window. Works fine.
However, if we open the dashboard in one tab and then click any link in the menu bar parent page is opened but is not linked to child window. When we use javascript code to know if the parent window is opened or not it comes as false. Now , child window open login page in child window and parent page also display login page.
How can I know if the parent window is still open and apply the logic to handle this scenario.
There is a question Facebook OAuth "Unsupported" in Chrome on iOS where there are fixes with manually redirecting to login screen and back to the original url.
But, I have situation when login button is in the iframe within popup on some page. This popup could be displayed on multiple sites.
Redirect_uri should be the page of facebook application, in this example iframe inside popup. I need it to be redirecting on the original page.
Any ideas?
Update:
Even with Manual login flow, it doesn't work. It's not redirecting me anywhere after login. Just same facebook window with message "Please close this tab to proceed".
I am trying to parse a whole website
Target Link: http://targetsite.com
which has lots of child links and I want to parse all its child links.
Links within the Target Page:-
http://targetsite.com/childpage/1
http://targetsite.com/childpage/2
http://targetsite.com/childpage/3
The problem I am having is that if I am directly opening these links for example -
http://targetsite.com/childpage/1
using either Curl or Python urllib2 or Python Selenium.
Then the website is redirecting me to CAPTCHA Page first to Prevent Automated Malicious Programs from parsing that page.
But if I open that link by click it in then its Opens without redirecting to CAPTCHA page.
Opening http://targetsite.com/childpage/1
By clicking this link from http://targetsite.com main page.
And then it displays that page.
I want to know how the website is tracking whether a link has been
opened directly or by click action.
Suggest a suitable way to do this kind of Web Scraping automatically in Python
NOTE:-
I have also tried it by just copy pasting that link to browser and opening it directly without using click action in that case too its redirecting to CAPTCHA Page.
I have a website build in php, in some page i show a iframe with another website link, which displays it's login screen.
Both Websites are in different domain.
Like main website : http://www.abcd.com
Iframe href : http://www.xyz.com
Now my users see a page in abcd.com where there is an iframe like
<iframe src="http://www.xyz.com/" style="width:688px; height:384px;"></iframe>
Which displays the login screen of the xyz.com
Now what i want is, if users login to xyz.com another new tab should open with the homepage, after login of xyz.com and abcd.com tab should get close.
Is it possible to do with javascript or jquery, which works for all the browser including IE 7,8,9 ??
Thanks
Open up a new tab
link
linky
pop up
window.open("foo.html", "_blank");
Put the following javascript code in the <head> tag of the homepage of xyz.com (but don't put it in the login page if you still want to keep the login page inside the iframe):
<script type="text/javascript">
if (top.location!= self.location){
top.location = self.location
}
</script>
now, when opening the home page of xyz.com, this code will break the <iframe> and changes the current tab from abcd.com to the home page of xyz.com
i dont know what you mean, but opening a new tab from iframe is just the normal code.
<button>Open New Tab</button>
hope this helps
What you're trying to do is impossible on your end, you only supply a login page inside the iFrame, therefor you cant control what the "login" button actually does, it's controlled by the other website.
The other website will need to edit the action themselves and add target='_blank', but that wont happen as their users will have another tab when they login.
I have a question on javascript window management.
My application opens an iframe which displays a link. Clicking on the link, opens a popup window, in which I enter my login credentials. My intention is to close the popup window after the login credentials are entered. And this I have been able to achieve using a JS call to self.close().
There after my server side script does some more processing and would like to display the results back in the iframe. This is where things break for me.
The overall flow is as follows:
Iframe Displays a Link --> Clicking on the Link Pops up a window --> Popup Window closes after credentials are entered --> I see my original iframe now (How do I display the contents back in the iframe). Here is the code snippet that closes the popup.
5
6 self.close();
7
The parent of the popup is the iframe. If I modify the above script to give the focus back to its parent, which in my case will be the iframe, will that suffice? Or am I issing something here?
you can access the iframe from your popup by using opener. for example this will reload your iframe:
<script type="text/javascript">
opener.location.href = "htp://mypage.com/myiframe.php";
</script>
you just have to add the right parameters to show what you want to. (of course you have to do this before your self.close();)