3

To retrieve user passwords I search for them at:

- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id )listener

this gets called, among others, when the user submits a login form..

However, I have come across following web-site: Store

Here, when the user submits the login, no event from the WebPolicyDelegate is raised. It seems as if no action is taking place. The way the passwords are saved works for all other web sites I have tested (20+).

Any1 knows what is happening here? How could I retrieve the password content at this site when the user submits the form??

UPDATE

I now get the event call thanks to UIWebViewDelegate not monitoring XMLHttpRequest?, however, I am not able to access the password element. How can I retrieve it?

The problem is that the call [actionInformation objectForKey:@"WebActionFormKey"]; within webView:decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:frame:decisionListener: returns nil

Community
  • 1
  • 1
Daniel
  • 20,420
  • 10
  • 92
  • 149

1 Answers1

2

The page you're revering to uses AJAX to logon.

The WebPolicyDelegate is however only invoked on a page load. AJAX calls are no typical page load, the URL in the address bar remains after all the same after submitting the logon form. In conclusion, the WebPolicyDelegate is not invoked because no typical navigation actions takes place.

Anne
  • 26,765
  • 9
  • 65
  • 71
  • Is there any other delegate function called when an ajax call is made? Or any other way to retrieve the submit action? – Daniel Sep 25 '12 at 08:42
  • I have been looking for a simple solution as well. I finally gave up. As far I'm aware, no delegate is triggered during AJAX calls. Sorry. – Anne Sep 26 '12 at 12:31
  • Do you know of any... complicated solution? I have found: http://stackoverflow.com/questions/5353278/uiwebviewdelegate-not-monitoring-xmlhttprequest which may be the way to go.. unfortunatelly I have absolutelly no knowledge of AJAX and I couldn't make it work – Daniel Sep 26 '12 at 13:31
  • Ok, it works now, I wasn't adding the file at resources so it wasn't read. However, I dcan't get the form with `DOMHTMLFormElement *formElem = [actionInformation objectForKey:@"WebActionFormKey"];` which means I cannot get the password. How can I access the password?? – Daniel Oct 01 '12 at 13:45