DotNetBrowser vs CefSharp Comparison - cefsharp

I'm considering moving a project into an embedded WebView type architecture in a WinForm application and am considering DotNetBrowser and CefSharp.
After many searches I can't seem to find any comparison between the capabilities of the free CefSharp project vs the paid DotNetBrowser component. Is the primary difference the support options with DotNetBrowser are there other documented differences?

The major difference between DotNetBrowser and CefSharp APIs is that DotNetBrowser provides the DOM layer API while CefSharp doesn't.
For example, in DotNetBrowser, you can get the DOM element using the following approach:
DOMDocument document = Browser.GetDocument();
DOMNode div = Browser.GetDocument().GetElementsByTagName("div").FirstOrDefault();
And then you can work with the DOM element using C#. For instance, DotNetBrowser supports subscribing to DOM events from .NET side.
To do this in CefSharp, you need to use JavaScript evaluation for working with DOM tree:
browser.GetMainFrame().ExecuteJavaScriptAsync("document.getElementsByTagName('div')[0]");

Related

Applying stylesheets to VB.net form controls

I'm using a Windows Form Application in Visual Studio 2013 to design a prototype for a software. I'm not a software-developer, the only purpose of the project is to communicate with the dev-team to let them know what the end-product is supposed to look like.
There is not really much flexibility when it comes to designing control, like buttons, textboxes, etc. so I was wondering if it is possible to attach stylesheets to VB.NET projects? Thank you
There is not really much flexibility when it comes to designing
control, like buttons, textboxes, etc.
NO. winforms is a really old technology that basically has no amount of built-in support for custom UIs. It is not recommended for any new projects (only to maintain legacy applications) and it will be completely useless if you're not a developer, since any sort of custom look and feel needs to be done with an ugly procedural code technique called "owner draw", which requires too much code for anything, and is unable to provide professional-looking UIs due to the lack of hardware acceleration and lack of support for pixel-independent UIs.
If you're doing a prototype (as opposed to a real application), as others have recommended, you should use design tools such as Photoshop, or maybe a quick HTML + CSS kind of approach.
Otherwise, you can easily create a modern-looking application using a technology that is the replacement of winforms, called Windows Presentation Foundation, or WPF, for short.
There's also a design tool made specifically for this technology, called Expression Blend, which is bundled with recent versions of Visual Studio, and offers a very designer-centric approach to building UIs:
To summarize: winforms is useless. Use proper, relevant, current technology instead.
There are no such things as stylesheets in WinForms applications. You can change the appareance on a form and control basis by changing the Appearance properties.
You can create base controls and forms that have your appearance changes and then use those to create other forms to make things easier to design out the screen.
There are also 3rd party control sets that do have skins/themes, which maybe what you want but you have to purchase them first then you are limited to that control suite.

Using Selenium WebDriver in custom extension

I am developing a Firefox extension and have a need to generate synthetic events. I want this events to be treated as 'native' events. However, the DOM APIs exposed by Firefox (createEvent, initEvent) aren't really behaving as native events. I realized Selenium solved the issue by adopting native events.
My question is, can I use webdriver.xpi standalone within my extension? My extension is JavaScript based. If yes, how? Has anyone done it before?
Any pointers will be highly appreciated.
Selenium is unnecessary:
You can use nsIDOMWindowUtils.sendMouseEventToWindow() instead of document.createEvent(). This method is meant for testing and will generate a native event as well.
References
Are events generated by Firefox extension 'trusted'?

How does Angular JS relate to Google Closure?

Now that AngularJS 1.0 is released I am wondering how this project fits together with the other general-purpose JavaScript framework / tool from Google, Closure.
I have only seen basic description of those two technologies (and read about a half of the book on Closure) so I have no direct experience but this is how it looks to me:
Closure is a set of technologies that can be used separately. What I find probably the most appealing is:
Closure Compiler which seems to "fix JavaScript" in a sense that it warns against typical issues, provides some compile-time checks (not all people like this but probably most Google developers do, and I do too). And of course it's nice that the resulting code is smaller and more efficient.
Then there are some parts of Closure Library that I like, e.g. abstractions over built-in types (ArrayLike etc.), class-based system, eventing mechanism, DOM abstractions etc. I'm not sure yet if I like the GUI library or not (seems to be quite complex and I didn't really have time to study it yet).
Then there are some features that I don't think I would find that useful, e.g. Templates.
AngularJS, which I've only read briefly about, seems to be much higher-level than Closure. It seems to be an application framework providing features like data binding, reusable components, MVC structure etc.
So these two technologies seem to be aimed at quite a different level of abstraction so my first thought was, can they be used together? Closure providing low-level compiler and browser abstractions while Angular providing application-level services and structure? Would it make sense and would it work well together?
The only Google project I'm aware of that uses AngularJS is the DoubleClick team. (presentation) Essentially, they still use Google Closure Library for everything but the UI building. Also note that they use Google Closure Compiler, but that's almost a given, "nobody" uses only the Library without the Compiler.
Google Closure Library comes with a UI framework in its goog.ui namespace. This framework compares in almost every way to non-web UI frameworks like Android, iOS, Swing and QT. They have a thing I like to call DOM elements on steroids, goog.ui.Component, which has lots of great life cycle mechanisms for garbage collection and event listening and more. You have things like goog.ui.Control, which is a subclass of goog.ui.Component, and handles user interaction in a very interesting way. It lets you plug renderers, for example, so you can change a <button> to an <a> without changing any of your other logic except the actual rendering.
Speaking of classes and subclasses, Google Closure Library also has this. You don't have to use the built-in one, the important part is that you somehow call the prototype of the "superclass" in your methods. You can for example use the class system in CoffeeScript, Google Closure Library doesn't care.
The reason the DoubleClick team chose AngularJS was apparently largely because of the data binding features AngularJS provides. There's nothing built-in in Google Closure Library to automatically update the UI when data changes.
So to summarize, Google Closure is a huuuuge beast, and AngularJS can replace the goog.ui part of the Google Closure Library.
I think AngularJS is more like a solid MVC/MVVM framework and Closure Library is a set of loose components, although both AngularJS Templates and Closure Templates have much in common.

Client Technology Choice - Any HTML5/Canvas libraries as capable as Flash/Flex?

I know similar questions have been closed for it being "impossible to answer objectively", but stick with me here.
I built a prototype in Adobe Flex, they (customers) liked it. Everything was fine until they later told me that iPads / iOS needs to be supported too.
I checked out Adobe's Packager for iPhone. We're evaluating that and we will know if it works out in a couple of days. (We need to get through Apple's red tape and certificates raj so this angle is delayed by a few days!)
There is a growing voice for using HTML5/Canvas as a technology platform itself. And despite being quite proficient in Flex, I think this makes sense.
I'm in need of a HTML5 library that can:
Render "widgets" i.e. containers with forms and components (this should be easy and possible using POHJC - Plain old HTML, JavaScript and CSS ;-) )
Provide a Tree like control for laying out some data
Provide a Canvas where data structures can be represented as basic shapes
Provide drag and drop capabilities between Trees, Buttons and Canvas
Provide some sort of Tab Navigator container (I guess JQuery works here)
Interact with back-end services (JSON/XML calls will be okay, but mapping directly with back-end entities will be awesome!)
Renders on latest versions of major browsers, Android OS and iOS (WebKit for mobile?)
Am I asking for too much?
I'm ready to give JQuery & JQuery UI a try.
I looked at Sencha / ExtJS but it seems we need to maintain two code bases one for normal browsers and the other for mobiles (is that correct?)
Are there any other JS libraries worth trying out?
My concerns areas are
Single code base, I don't want to suggest to them that multiple code bases for the client need to be maintained. That's a last resort option and would lead to complete ruling out of HTML5 with Flash apps and native apps being developed.
Canvas capabilities - I don't want to work with raw canvas and shape tags. This too is a last resort option. Is there any abstraction available?
Integration with back-end services, obviously I need some capability here!
Help me out. Communitywikify this if required.
Thanks,
Sri
How about trying Vaadin?
http://vaadin.com/comparison
I do construe its irrelevant to your question, but still this framework can help in great deal. I still use Flex and PHP as main base for many application, but actually fell in love with Vaadin and started using it for my new projects.
Grant Skinner the flash guru is working on a html5 libary. It has some features you requested. It is still in development.
The new Canvas element in HTML5 is powerful, but it can be difficult to work with. It has no internal concept of discrete display elements, so you are required to manage updates manually. The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with Canvas much easier.
The libary is called easeljs, you can find it here : http://easeljs.com/
For the normal html and css manipulations without html canvas JQuery is very easy to learn.

JQuery or Any other Java Script Lib. for Developing Web application

Recently i completed on mid level web application where i have used telerik controls,
all the developers in project used native javascript functions as well as telerik
functions to work with javascript.
We faced so many cross browser issues in this approach, we have solved all the issues but i am just wondering that what should be the best approach ?
Do i need to consider JQuery for the next project for avoiding cross browser issues or there is any other option
I want my application should work perfectly in (IE 6+, FF 2+ & Chrome)
Please suggest the appropriate solution.
I prefer using jQuery. It helped me lot to develop rich applications without writing code that target each and every browser.
Also I found their documentation to be relatively simple and have a large user base which is quite an advantage for a library. Also there are plenty of plug ins that are built on top of jQuery.
If you are doing trivial amounts of JS, then a framework is usually going to be more bandwidth than it is worth. (It doesn't sound like you are, but I think it is important to get that statement out of the way first).
Once you get into serious amounts of JavaScript, then it is worth looking at the various frameworks out there.
jQuery is popular. I prefer YUI. I've heard good reports about ExtJS for projects described as "web applications". There are a number of other popular choices.
It is worth evaluating which best suits the sort of projects you are working on.
I used telerik controls in the past, and I have to say that they are quite a pain in the butt. They are very rigid and don't allow you any control. I have found that YUI provides you with a solid javascript framework that has all the features telerik offers, but with non of the limitations.
Check it out here
Most people here will suggest you use jQuery. I would suggest you sketch out your requirements and priorities before starting development on your next project and evaluating libraries based on your list of requirements. Using any large general purpose library such as jQuery or Prototype will have implications (download size/delay for user, code quality, trade-offs between generality and speed) you should be aware of before using them.
as most have already posted, it all depends on what you need to do, i used jQuery, script.aculo.us, and Mootools for some time, and for lightweight effects mootools was the most appropriate, as for support and medium sized projects jQuery. script.aculo.us is pretty usefull as it is based on prototype, but it took me some time to figure out how to actually use it effectively
I personally prefer JQuery and ASP.NET AJAX (Microsoft AJAX Library). There are so many JQuery Plug-in available which you can try them out. As for ASP.NET platform, Microsoft AJAX Library is inevitable because of its simplicity and tight integration with ASP.NET controls. Recently, JQuery has attained citizenship in Visual Studio 2008. This should also be taken into account.

Resources