Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to reply to JavaScript "wiindow.navigator.appName" in webkit program



I got a program developed in webkit that act as a browser. But when
connect to some .NET pages that has an auto generated  function named
__doPostBack.:

<script language="javascript">

<!--

            function __doPostBack(eventTarget, eventArgument) {

                        var theform;

                        if
(window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {

                                    theform = document.forms["Form1"];

                        }

                        else {

                                    theform = document.Form1;

                        }

                        theform.__EVENTTARGET.value =
eventTarget.split("$").join(":");

                        theform.__EVENTARGUMENT.value = eventArgument;

                        theform.submit();

            }

// -->

</script>

  As noted this doPostBack has an if condition to check what type of
browser it is by querying the javascript "window.navigator.appName".  My
custom webkit bowser is returning an unknown value.



I added:  [webView setApplicationNameForUserAgent:@"Netscape"]; but it
didn't work. Can anyone tell me what webkit function to call in order to
return a proper value to Javascript's "window.navigator.appName" ?
thanks.
_______________________________________________
webkitsdk-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webkitsdk-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.