Summary: | SWT Browser location listener not catching internal redirections | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | abhinav anand <abhinav_dba> | ||||
Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | daniel_megert, mathias, niraj.modi | ||||
Version: | 4.5 | Keywords: | needinfo | ||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows 7 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
abhinav anand
2015-04-17 06:44:40 EDT
Can you please upload a small snippet of code which demonstrates the problem? Here it is: Browser browser = new Browser(browserShell, SWT.Resize); browserShell.setSize(580, 550); browser.setSize(browserShell.getSize()); GridDataFactory.fillDefaults().grab(true, true).applyTo(browserShell); GridDataFactory.fillDefaults().grab(true, true).applyTo(browser); browser.setUrl("url"); browser.addLocationListener(new LocationListener() { @Override public void changing(LocationEvent event) { // TODO Auto-generated method stub System.out.println(event.location); } @Override public void changed(LocationEvent event) { // TODO Auto-generated method stub System.out.println(event.location); if (event.location.startsWith("http://localhost")) { }}}); The url here is a server which redirects to another url.This redirect url comes as a part of the response header. Hey, Any progress on the issue? Hi Guys, This is really creating problems for me,hence raising the prio. Created attachment 253225 [details] TestSnippet --- WORKS_FOR_ME on IE10_Win7 This scenario works for me on Windows7 on IE10, tried opening www.google.com which in India internally redirects to www.google.co.in Test results with my Snippet, on console: changed...about:blank changing...http://www.google.com/ changing...http://www.google.co.in/?gfe_rd=cr&ei=fxNKVdPdDNCCuASgsoCwAQ changing...https://www.google.co.in/?gfe_rd=cr&ei=fxNKVdPdDNCCuASgsoCwAQ&gws_rd=ssl changed...https://www.google.co.in/?gfe_rd=cr&ei=fxNKVdPdDNCCuASgsoCwAQ&gws_rd=ssl changed...https://www.google.co.in/?gfe_rd=cr&ei=fxNKVdPdDNCCuASgsoCwAQ&gws_rd=ssl changed...https://www.google.co.in/?gfe_rd=cr&ei=fxNKVdPdDNCCuASgsoCwAQ&gws_rd=ssl If the attached test snippet fails for your, please revert with your Browser version and any specific information to reproduce this issue at our end ? Thanks. Hi, I recently found out that the if the internal redirection is to a url which is of a server that is not up and running , of course the page cannot be loaded but the event for this url is not fired. For any server that is running the event is generated. For example: if google redirects to a localhost server which is not running , the event wont be generated ,however if redirection is to google.co.in, it will work. But i think the correct behaviour should be to generate events for both since there was an attempt to load a new url irrespective of whether the server is running. JAVAFX works this way. It generates events for both. Hence i think this should be fixed. Regards, Abhinav. I totally agree. I have the same issue. (In reply to abhinav anand from comment #6) > Hi, > I recently found out that the if the internal redirection is to a url which > is of a server that is not up and running , of course the page cannot be > loaded but the event for this url is not fired. For any server that is > running the event is generated. > For example: if google redirects to a localhost server which is not running > , the event wont be generated ,however if redirection is to google.co.in, it > will work. > > But i think the correct behaviour should be to generate events for both > since there was an attempt to load a new url irrespective of whether the > server is running. > JAVAFX works this way. It generates events for both. > Hence i think this should be fixed. > > > Regards, > Abhinav. |