WebKit - what does it do? - webkit

Tell me please, the only thing I understand at the moment is that WebKit is a C ++ library, which somehow, if I understand correctly, takes a full-fledged HTML page as input and somehow renders / renders it ??
And if Javacscript, Jquery and Ajax are used in HTML, does the library also process them itself or what? And does ajax initiate itself?
If it’s not difficult, tell me, are there any simple examples / lessons where one could start in order to understand how WebKit works and what it does?
PS: Is it possible to use WebKit for parsing sites?

WebKit is a web browser engine. It is my understanding that yes, it also processes Javascript inside the HTML as that is part of what a web browser engine does. You can read more at Webkit's homepage: https://webkit.org/

Related

Objective C get html page's links

I'm quite new in Objective C programming and I'm trying to make an application that returns all the link addresses in HTML page. In that case i shouldn't just parse the HTML, but get these links intercepting them from the page's network request.
Is it possible to intercept the application's network requests or something?
Thanks
Coincidentally, Ray Wenderlich's rather AWESOME iOS tutorial site posted this article in the last hour. As you are new to iOS/ObjC, I highly recommend reading it thoroughly.
Let’s say you want to find some information inside a web page and
display it in a custom way in your app.
This technique is called
“scraping.” Let’s also assume you’ve thought through alternatives to
scraping web pages from inside your app, and are pretty sure that’s
what you want to do.
Well then you get to the question – how can you
programmatically dig through the HTML and find the part you’re looking
for, in the most robust way possible? Believe it or not, regular
expressions won’t cut it!
And before you think Regular Expressions might really be an answer, please read this.

Cross-Platform GUI development between wxPython and Mono

I've been thinking to give GUI development a try lately and am torn with the choice of between wxPython and Mono.
Judging from what I've seen out there, wxPython people seem to use the WebKit trick to produce nice (doesn't have to be beautiful) UI.
How hard is it to do the following in each of the platform:
1) Custom Control
2) Use HTML rendering
I don't quite understand how far the HTML rendering works via WebKit in wxPython (i.e.: does it support separate CSS/JS files? how's the JS support? do we need to write extra wxPython code to run the JS? how hard it is to integrate between JS events and wxPython widgets? what are the usual strategy of integrating WebKit with wxPython?)
Mind to share your thought on this subject? I specifically pick either wxPython or Mono, not Java Swing for no reason.
PS: I'm aware of certain limitation of cross-platform UI (as in: it won't be 100% native) and I could care less of such things.
wxPython has wxWebkit available via the new WebView widget, but WebKit is only available on Mac and Linux right now. WebView uses a different rendering engine on Windows called Trident from IE (see http://wxpython.org/CHANGES.html). So you'll want to keep that in mind.
Either way, we're talking about browser engines that display HTML, CSS, etc. They should, theoretically, display whatever those engines support. You'll have to look up their specifications to be sure and also make sure to check if the port supports everything. As I understand it, they should definitely support the usual HTML and CSS and I would assume normal javascript. If I were you, I'd just create a simple window in wxPython and then load the web page you've created and see how it works.
I don't know how the javascript communicates with wxPython or if it even does. You'll want to ask on their mailing list for that kind of information.

WebKit in Java application

Is it possible to integrate a webkit engine in a java application.
Here is my thinking, I would like to implement my User Interface using javascript and business logic in Java and want to communicate back and forth between the js and java. I have looked at titanium and chromiumembedded. But i dont get the complete picture. Can anyone give me a good explanation of webkit being used in a standalone application.
There are a few solutions, the main one being for SWT. See here for the SWT solution. There was a similar question here referring to SWING.
Edit: Oh my, I can't believe I forgot Lobo, a browser written in Java. More Specifically, their Browser API providers support for embedding. This seems to be the better solution for cross-platform and possibly stability. I'm not 100% sure on the first two solutions' development. Hope that provides some insight.
JavaFX 2 has an embedded browser component based on Webkit. There is a tutorial provided by Oracle here.

dynamic content - where do i start?

I have a rather simple question. I want to dynamically change the content of a based on the selection of a drop down menu. The drop down menu is populated by a php loop that gets data from a mysql database. So far, I'm only familiar with php and html/css.
I don't really know where to start, or more specifically, what technologies I should be researching. So far, I've heard AJAX, JQuery, JavaScript, NOLOH, HTML iframes, pure CSS, etc. I really just want to know where to look!
Start off with the basics: HTML (if you're feeling adventurous, you could try HTML5) and CSS.
After your comfortable with that, you can start getting a little more complex and pick up JavaScript. This is how the majority of the 'dynamic' bits of web pages are accomplished so learn it well.
Once you've got the JavaScript basics down, you can learn how to use JavaScript to manipulate the DOM (Document Object Model) and make AJAX requests back to the server to get new content to insert.

Testing a "Dojo" web application with Selenium

Has anyone done some extensive automation with Selenium and a Dojo-heavy web app? I'm looking for any issues or problem that you might have run into or issues related directly to the combination of Selenium and Dojo.
I've used Selenium extensively with a bunch of different web apps, including a few on Dojo. You should be fine. One practice I would recommend is to make sure all the components you'll be testing (both UI controls you'll be driving, as well as text components you'll be reading for testing) have ID tags set. Selenium has a bunch of elegant selectors to get at the elements you need, but selection by ID is still the best. The other methods can be more brittle.
I've had some challenging experiences with Selenium RC not being as compatible with my code as Selenium IDE, to the point that I stopped using Selenium RC. And in case you are not super familiar with Selenium, you should be aware that it doesn't natively support some (IMO) pretty fundamental features like flow control and includes; but there are user extensions to the framework that allow this. I'd also recommend taking a look at Watir which I now generally prefer over Selenium because it exposes the full power/flexibility of a first class language (Ruby).
I'm working on a Dojo-heavy app right now, and am making a number of tests with Selenium IDE. I've ran into a few issues with certain Dojo elements, such as drop down menus and tabbed components. I've learned to appreciate XPath, and have been experimenting with how clickAt and waitForElementPosition commands, which seem to help accommodate for some of Dojo's features.
Dojo specifics - very brief
The Dojo itself differs in some approaches from other heavy-DOM and extensively impressive frameworks (like ExtJS, jQuery, YUI).
The general Dojo specific it workaround the limitations by using Flash (YUI does as well) or Silverlight.
Here is a couple scenarious when Dojo can use Fash:
the browser is not HTML5 and javascript need local storage. Then Dojo will use "Flash Cookie" Flash Local Shared Objects (package dojox.storage)
need support of cross domain https calls.
The general tricks that can turn your testing into something difficult:
browser messages, like "do you wish to allow this site..."
nested frames can make the selection of the node difficult
javascript timeout/intervals they might work with different speed in Selenium then in real browser. Yes they can.
The biggest issue I encountered was the fact that dojo menus, and pop-up UI elements in general, are absolutely positioned as children of the body element and are not children of the element that creates them.
This can impact how you write Selenium CSS Selector and, in my case, made it a bit more challenging to automatically crop a screenshot that includes a menu and its dropdown.
Selenium should be fine with dojo because it's rendered in Firefox and not on it's own. Just make sure dojo is available when testing ( i.e. don't connect to google's cdn if your test environment doesn't have an internet connection ). But that's a problem you'd have with any external resource
I have no experience, but did see http://www.ibm.com/developerworks/opensource/library/os-webautoselenium/index.html discussing how to use Selenium with dojo
If you need to test in an SSL environment and you use Selenium RC's trustAllSslCertificates + proxy, you must make sure all of your JS files are hosted on the same domain. I've seen problems recently with using CDNs to load JS and image files when testing under recent Firefox versions and selenium rc