javascript - How to programmatically set the value of a WebKit password text field? -


Update: This question is closed. Move along, nothing to see here. You can do set the value of the password text field either with js or objc I was wrong.

I have a webkit based coke app that loads in an HTML document in a WebView HTML form has a password text field like:

  & lt; Form name = "foo" & gt; & Lt; Input type = "password" name = "bar" & gt; & Lt; / Form & gt;  

I want to set the value of this text field programmatically (if possible, with the objective, but whatever I do).

I believe webkit (and every other modern browser) implements a JavaScript security feature which prevents JS scripts from setting this value to a program.

Unfortunately, it seems that the same security restriction applies to the purpose-C, because I can not use the objcci to determine the value while js restrictions are fair, objc seems a little unfair is.

Is the program a way to determine the value of this area (there is a lack of bundling a custom webkit in my app that has been changed to change it)? I am open to any suggestions.

Here I have tried which ObjC:

  DOMHTMLDocument * doc = (DOMHTMLDocument *) [webView mainFrameDocument]; DOMHTMLFormElement * formEl = (DOMHTMLFormElement *) [[Doc forms] Named: @ "Foo"]; DOMHTMLInputElement * inputEl = (DOMHTMLInputElement *) [[formEl element] nameItem: @ "bar"]; [InputEl set valley: @ "Falcon"];  

It has no effect.

It should work without any certification to do so by jumping through any hoops . I have just written a quick test app that has been loaded with the following code on Snooplipard and Leopard and signed in:

  - (zero) webview: (webview *) Sender didFinishLoadForFrame: (Webframe *) frame {if (! [[Sender main frame] is aqual: frame] return; DOMHTMLFormElement * form = (DOMHTMLFormElement *) [[Frame Domdocution] getElementById: @ "gaia_loginform"]; DOMHTMLInputElement * User Name = (DOMHTMLInputElement *) [[Name of Elements] nameItem: @ "Email"]; [Username set value: @ "MyMailAct"]; DOMHTMLInputElement * password = (DOMHTMLInputElement *) [[Name of Elements] nameItem: @ "Passwd"]; [Password set value: @ "ompi"]; [Submit form]; }  

I have a lot of code at work, whose only work is to sign the website and it is working fine on Tiger for one year. In that situation, I do everything, which includes the webwife through code. I would also be surprised that the autofill of Safari did not use such a code.

He said, I will make sure that your app is not doing anything for the webview. Do you make any other modifications to the DOM elsewhere? Try doing such a sample app as I did and see that it works there.

Are you loading HTML on your own or remote server? Some websites include javascript which clears form fields of load or after one or two or two to prevent automatic filling. Maybe you're running in it?

If everything fails, make sure that nothing is being logged in the webview console, you can see that by opening the web inspector or by temporarily applying the private web eidetlet method :

  - (zero) webview: (webview *) Webview AddMessageToConsole: (NSDictionary *) message;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -