Thread: WebKit in C#.NET with configs

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    62

    WebKit in C#.NET with configs

    Hello all!
    I'm in the process of making my own browser (for education's purpose, as well as using it for myself later on).

    I'm using C#.NET (with VS2010), mostly cause I'm lazy to do all the GUI myself.

    So I've stopped on WebKit, which seems to be the better choice even now. And I've asked myself -> how will the settings be implemented.

    What I wanted to do, was something similar to about:config or chrome options (since build 14)...
    But I had no idea on how to actually do it!

    It involves saving the settings file through a webpage, which can be done quite easily with PHP (on the server, I'm not sure about the client), but PHP is out of the question as I won't force the user to install XAMMP and everything just because of my whim...

    So the question is, can it be done with JavaScript (or some other methd), if so how?

    By the way, all you admins, before you move this to the Tech Board, please notice that I do not know of how this can be done, and the answer may be done in C#, which I am using, so I would prefer if this stayed in the category I posted it to. Ty!

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    about:config doesn't need to be an actual webpage. But if you want to emulate the behavior of browsers like Firefox or Chrome, you use javascript. WebKit, naturally, supports javascript. Otherwise you can implement the feature entirely in C#. Particularly easy if you use WPF since you can simply draw a panel inside the web container where pages are rendered. A tad bit more complex if you use WinForms.

    As for how to do it in javascript, you need to join some javascript forum. We here deal with C, C++, C#, Assembly, etc. We do answer to the occasional off-topic language. But never to the extent that would be required here. You need to learn how to program in Javascript for this.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Location
    england
    Posts
    209
    I don't use Firefox/Chrome but as I understand it about:config submits a page locally to update the browser's settings. For simplicity you could use the System.Net.HttpListener class to host a small local web server to handle such POST requests/responses. You wouldn't need any server side scripting language as all the request variables can be obtained using the Request.Forms collection and then handled as standard by your application in C#.

    Doing it this way will avoid the need to use any server or client side scripting languages, other than if you wanted to go down the route of AJAX for submitting the settings. In which case the W3 website has a bunch of useful tutorials for javascript http request submitting.
    Last edited by theoobe; 09-27-2011 at 06:04 AM.

  4. #4
    Registered User
    Join Date
    Jul 2011
    Posts
    62
    Hum, thanks. What I was thinking of was to make the page Javascript and save it in the directory of the program...
    (and name it something else)... then use JavaScript to write to a file in the same directory... But http listener seems interesting I'll look into it, thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Call C Function from WebKit
    By VarwigSoftware in forum C Programming
    Replies: 2
    Last Post: 12-15-2010, 10:29 PM

Tags for this Thread