Filling Webview Content Automaticly

tayyipemretayyipemre Member ✭✭
Hi.
I'm developing a webview application. and here I want the fields to come automatically after the first entry. Can you help with the topic?

Posts

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited May 14

    Sorry. WebView is just a URL to a page (or HTML content you that you provided).
    After that... You're done. You don't get to futz with the content.
    Its sandboxed off for the privacy and security of the the user.

    Keeps bad actors from making look-a-like apps then stealing log in information, banking details and so on.

  • tayyipemretayyipemre Member ✭✭
    I understand what you mean. but this app users will only be in-house. and what I want to do is register it in the same way that Google Chrome records it as in the picture
    @ClintStLaurent
  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    I understand what you mean. but this app users will only be in-house.

    I get that. But what you want, and what you intend doesn't change how the control is coded, anymore than your intention of how you'll use a truck is different than the other guy's intention is going to somehow change the way the truck was designed.

    It does what it does, the way the people that made it designed it to work.

  • tayyipemretayyipemre Member ✭✭
    I want to pass this login page quickly. Everytime we do not write username and pass.
    @ClintStLaurent
  • JohnHardmanJohnHardman GBUniversity mod

    @tayyipemre said:
    Hi.
    I'm developing a webview application. and here I want the fields to come automatically after the first entry. Can you help with the topic?

    Assuming that the page is not implemented in a way that prevents this - Inject some JavaScript into the page when loading of the page is complete, where the injected JavaScript finds and then populates the field(s).

    @tayyipemre said:
    I want to pass this login page quickly. Everytime we do not write username and pass.

    I would strongly advise against automatically populating the password. Even if you just want to do this during development, there is the risk that code might get inadvertently left in place when you publish to production.

  • tayyipemretayyipemre Member ✭✭
    @JohnHardman
    @ClintStLaurent
    Ok. Thank u for helping. I just wondered. It would be easy for me if I had such a solution.
  • JohnHardmanJohnHardman GBUniversity mod

    @tayyipemre said:
    It would be easy for me if I had such a solution.

    @JohnHardman said:
    Assuming that the page is not implemented in a way that prevents this - Inject some JavaScript into the page when loading of the page is complete, where the injected JavaScript finds and then populates the field(s).

    It's not difficult, just fiddly. For the JavaScript, you'll want to look at using the following:

    • getElementById or getElementsByTagName
    • setAttribute

    If you're not familiar with JavaScript, I recommend reading "DOM Scripting - Web Design with JavaScript and the Document Object Model" by Jeremy Keith. Personally, I reckon that book should be compulsory reading for any techie, both for the content, but also as an example of how to write a really readable tech book.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited May 14

    Or just don't use the login page from the site at all.
    You can present your own XAML page from the app getting the user's name and password, then pass them programmatically to an AuthenticatedWebView which inherits from the OEM WebView (There are plenty of tutorials on the 'net for making it.
    The user doesn't know the difference.
    The user logs in one time to the APP, which stores the credentials for the lifespan of the session. Your app places them to the site.

    The issue I suspect is that you only know how to place some OEM controls on a page and want us to give you the rest. Otherwise you would have done a bit of research, seen this technique used in several places and done some trial and error - then come here with specific questions about error or troubles and not "How do I make my program?"

  • tayyipemretayyipemre Member ✭✭
    You are absolutely right. I've polluted the forum unnecessarily. I've done research for a few days, but I didn't find after write forum. But now I understand not using right sentences. Thank you for your help. And I'm sorry.
  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    That's way too extreme of a response. Relax dude. Nobody thinks badly of you for asking questions: That's how we all learn. Just saying that you may have bitten off more than you can chew at this point of learning to code. Maybe a slightly smaller project to start? Or one that doesn't require so many convoluted requirements? Something with more basic browser and internet needs and build up to authentication and finding ways to work around normal workflow.

Sign In or Register to comment.