Writing a managed wrapper for Chromium [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Today I've been bouncing all around the internet, and after reading up on a lot of solutions I've decided that writing a Chromium wrapper would be an interesting learning experience; not to mention it would be worthwhile for several projects that I am currently working on.
I know that there are already some wrappers out there (awesomium, berkelium), not to mention some basic tutorials like this one, but I'm looking at writing my own wrapper.
My main interest in doing this is so that I am able to create and access the DOM structure generated by WebKit for use in C#, both before and after any javascript which the html depends on has been ran. I know I could look at using the HTMLAgilityPack and Majestic12 for HTML parsing, but I'm looking to build something on top of a tried and tested engine that is fast, efficient, and will be actively developed for the foreseeable future. WebKit is an actively developed layout engine embedded in some of the most popular browsers, and V8 is an impressive javascript engine, hence the decided use of Chromium.
Seeing as how I do not care about actually rendering any content and instead I am looking to access the structure of the web page, I feel that embedding WebKit in its entirety could potentially be overkill. Even in the instances where I'd like javascript to alter the DOM, I still have no use for rendering the results.
In summary:
All I truly want from Chromium is the ability to create the DOM of a web page, and (optionally) the ability to run said page's scripts using Chromium's impressive V8 engine to further manipulate the DOM. I know that this will be quite an undertaking, but I'm interested to see what you have to say. In short, has someone worked with WebKit and V8 (possibly via Chromium), who could assess the feasibility of this and lend me their expertise (via recommendations for how to approach this)? I know that I could eventually determine an appropriate way of approaching this, but I'm looking to expedite the process a bit. Links or perhaps a relatively short and sweet high-level "This is how I'd do it" are what I'm looking for (aka I don't need anything too terribly fancy).
I'm hoping that what I'm asking isn't too scatter-brained. If you find it too general and want to close this topic, instead of doing so please leave a comment and I'll try to narrow the focus. As I just stated my mind is bouncing around today since I'm coming down with a cold.

I'm on the same path. I'm looking deep on QtWebKit and the implementation done on PhantomJs which is a Selenium like, and worked like a charm on my tests.
When you use QtWebKit, as your driver to WebKit youll save time for next releases of it, because maintain a WebKit Port its not that easy.

I use Selenium Webdriver with ChromeDriver for automated script, web page and acceptance testing. Easy to set up, easy to use.
The idea is that you can use this existing interface, but change the path to the Chrome executable with ChromeOptions.BinaryLocation. Try pointing it to one of the existing headless builds of WebKit, like WebKitDriver - it might just work.
Our goals might be different, but I'd be interested in a headless version myself. It would be less obtrusive during testing on my dev machine, and I already take automated screenshots when a test fails.
selenium webdriver google-chrome chromedriver

Related

Web app or normal? software to develop this system idea? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
A friend has asked me to look into developing a custom system for his taxi cab company. Currently they have no system in place at all to handle their accounts or the jobs/booking etc. Eventually there will be extras like mobile applications to book but for now i need to get a backbone system developed.
He is talking about building it all as a web app, so all the accounts information/invoices etc are all in one location (most likely on a secure dedicated server) so that the ppl in the office or himself on his tablet if hes out and about can easily see what is what etc.
Part of me for some reason is not 100% convinced this is the best idea, but it does keep it all in the same place it does mean that if for example i write something in .net it doesnt need to be installed on all the machines and he can access it all from home or his tablet.
Can anyone think or link to a study paper or something, which might suggest which way is the better way to go with this? if its a web app it will most likely be done in php/html5 (i have been learning Django but dont think my skills are all there yet) if not a web app it will most likely be Java or C# (i am in the process of learning c++ but again skills arent all there.)
tldr: C#/Java system or php/html5 web app for a taxi accounts/booking system.
If this is the wrong place to post this sort of question, deepest apologies and close accordingly
I'm a desktop dev and in this case it's probably better done in the web.
If we use C#:
we have a server and a conbecting program. c# doesnt work everywhere (though java does) but just for something relatively small like this it's past overkill. but you can have offline data (if its needed though)
web:
easy to access (just need a browser) and light
THIRD OPTION:
C# can be used to develop web applications. as sich you can make it in C# and have it be accessible through a browser. (I would choose this, but I'm a desktop dev so I guess it's normal).
I'll leave you with this, mainly post to show you theres another way.
I'm not a desktop application developer, but I will chip in my opinion. The web has come a long way and it's very easy to make web user interfaces now. The biggest benefit you will probably gain from a web application is it is operating system dependent; anyone with a web browser will be able to use it.
My opinion,
I would have set up a server in Java/C# etc with a restservice or something similar, that way you can easily combine both web and desktop applications. Get the best of both worlds :)

Frameworks for Selenium in C# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Are there any open source frameworks based on Selenium WebDriver in C# that
Abstract all test and object logic away
Record actions straight into Selenium Webdriver C# code?
I am thinking of writing a framework (not sure about the recording feature), but maybe it's already been done!
•Abstract all test and object logic away -- must be done manually
Record actions straight into Selenium Webdriver C# code? -- the firefox plugin "selenium ide" can output test steps in C#. You can then use the "page object" design pattern to abstract away the object logic.
Here is the best example of using the "page object" pattern I have found. Example is C#
http://seleniumexamples.com/blog/examples/selenium2-in-net-framework/
C# frameworks for Selenium Webdriver:
https://github.com/ProtoTest/ProtoTest.Golem
https://github.com/ObjectivityBSS/Test.Automation
You can try Seleno:
http://teststack.github.com/TestStack.Seleno
It implements the Page Object pattern. It encourages a separation of concern between the logic of your page and your tests.
You can use the Selenium Firefox plugin to record actions, however in my experience it's only been useful for recording quick scripts to aid in development. The code it generates hasn't been of much use to myself.
Selenium IDE is a Firefox plugin that allows you to record your browser activity and export it to WebDriver C# code.
i've been looking for something similar for a while and came across this article on sauce labs which helped me quite a bit...
http://saucelabs.com/blog/index.php/2011/12/selenium-testing-framework-part-3-putting-it-all-together/
I have went down this route using the open source Selenide framework for java tests.
The fact that there is no de-facto standard selenium framework should be a sign that it isn't probably a good thing to. I would not recommend using a framework, I failed 2 times writing a testing suite because of it.
On the other hand writing a testing suite with very good OOP structure reflecting the webpage you are testing has worked wonders for me. The key is isolating the actual selenium webdriver code from the tests. You should very rarely use the reference to driver in tests, but instead initialize objects offering services (e.g. UI actions) representing the page elements you want to interact with and test. This is an ok example of this abstraction using the FindsBymethod in C#. The Page Object Model here is more or less what you should be going for.
It's alot of work to write a meta-application for UI testing instead of just copy and pasting recorded actions into code, but it does lead to more robust, reusable, and valuable tests.

Screen Scraping [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Just curious: What do you find to be your best tools for creating automated screen scrapes these days? is the .Net Agility pack a good option? What do you do about scraping sites that use a lot of AJAX?
I find that if the page has a pretty static layout, then the HTML Agility Pack is perfect for getting all the data I need. I've not run into a single page that it hasn't been able to handle and not get me the results I wanted.
If you find that the page is rendered with a great deal of dynamic code, you're going to have to do more than just download the page, you'll have to actually execute it.
To do that, you'll need something like the WebKit .NET library (a .NET wrapper around the WebKit rendering engine) which will allow you to download the page and actually execute Javascript as well. Then, once you are sure the document has been rendered completely, you can get the page details.
For the very basics I use:
Asynchronous HTTP Client - notably faster than the standard HttpWeb* (preliminary tests showed that it was about 25% faster).
Majestic 12 HTML Parser - about 50-100% faster than HTML Agility Pack.
I don't have JavaScript enabled yet, but I'm planning on using Google's V8 JavaScript Engine. This requires that you make calls to unmanaged code, but the performance of V8 justifies it.
For automating screen scraping, Selenium is a good tool. There are 2 things- 1) install Selenium IDE (works only in Firefox). 2) Install Selenium RC Server
After starting Selenium IDE, go to the site that you are trying to automate and start recording events that you do on the site. Think it as recording a macro in the browser. Afterwards, you get the code output for the language you want.
Just so you know Browsermob uses Selenium for load testing and for automating tasks on browser.
I've uploaded a ppt that I made a while back. This should save you a good amount of time- http://www.4shared.com/get/tlwT3qb_/SeleniumInstructions.html
In the above link select the option of regular download.
I spent good amount of time in figuring it out, so thought it may save somebody's time.
The best tool "these days" is one that not only gives you the desired features (Javascript, automation), but also the one that you don't have to run yourself... I am, of course, alluding to using a cloud service. This approach will save you network bandwidth, will deliver results faster (because it can scale better than a custom solution you'll likely end up developing) and, most importantly, save you the IT and maintenance headache.
On that note, check out a scraping solution called Bobik (http://usebobik.com). I've written an article about it at http://zscraper.wordpress.com/2012/07/03/a-comparison-shopping-android-app-without-backend/.
Hope this helps.

How to prevent decompilation of any C# application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
We are planning to develop a client server application using C# and MySQL. We plan to sell the product on the shelf like any other software utility. We are worried about the decompilation of our product which does have some sort of edge over our competitors in terms of usability and bundled functionality.
How can we prevent our software from decompilation, so the business logic of the product remains intact?
We have heard about Reflector and other decompilers which makes our code very much vulnerable for copying.
Our customer base is not Corporates but medical practitioners who themselves may not do it but our competitors may want to copy/disable licensing or even replicate the code/functionality so the value of our product goes down in the market.
Any suggestion to prevent this is most welcome.
If you deploy .NET assemblies to your client machines, some kind of decompilation will always be possible using reflector and similar tools.
However, this situation isn't materially different to what you'd encounter if you wrote the application in native C++. It is always possible to decompile things - if it were impossible, the processor couldn't understand it either.
You're never going to defeat the expert cracker - they'll treat your security as an intellectual puzzle to be solved for the challenge alone.
The question revolves around how hard it is to defeat your licensing practices and the return on investment.
Sit down with a spreadsheet and look through the possible scenarios - the danger is probably less than you think.
Factors like "ease of use" are visible in your software for any user to observe - so you'd think it easy to copy. But, good User experience is rare (and seldom copied well), because most developers (myself included) are nothing like typical users.
I'd suggest you concentrate on making the job of a cracker harder, cause you can never make it impossible, just non-profitable.
One possibility to try: It's possible to pre-compile assemblies into native code as a part of the installation process. Paint.NET does this for performance reasons. I believe that once you've done this, you can discard the original assemblies and use the optimised, native code editions.
If it were me, I wouldn't be attempt to obfuscate; I would:
Not worry about it and aim to continually improve and stay in front
But secondly
Consider providing the 'secret' services over the Web. It's up to you to decide how critical and possible this is; but it does "prevent" decompilation, because the end user doesn't even have the code.
Google for .NET Obfuscator. You will find a lot of products that will help in this. Also there are related questions already asked in Stack Overflow.
Here are some:
Dotfuscator
Secure Team
EDIT: While searching for De-Obfuscating tools, I came across an open source tool De4Dot. This tool supports decompiling obfucated dlls created by most commercial tools and does a pretty good job too.
Intellilock has served our purpose well in terms of obfuscation as well as licensing. But I would not recommend the product as the support is not upto the mark. We never got replies in time for the problem we were facing. We had to search and research on our own or even change the business requirement to achieve some goals.
Via this answer I am not intending to promote or demote any software but just want make people aware about the product we are using so they can make wise decision.
The last time I looked into this, Spices.Net Obfuscator looked like the best thing on the market.
No, I don't work for them. :)
I use smartassembly. It is simple to use and also has the ability to send crash reports back too you built in.
The obfuscators others have mentioned are likely very good.
An alternative approach you might not have considered is to code some of the core business logic using a language that is fully compiled to machine code, such as C++.
The benefit of doing this is that it makes it far more difficult for someone to decompile your code. A drawback to this is that you have code in two languages to maintain. This might not be the best approach for your situation, but is useful in cases where only a small part of the code needs to be obfuscated while the remainder of the code is UI fluff.
As an example, your medical software package might be performing edge detection of say, certain glands for the purpose of telling a doctor the size of said gland. The algorithm for calculating the size of the gland from a bitmap image would be contained in a DLL written in C++.
to answer your question about the C++ wrapper around the .net code; I dont think it would work, because when you deploy the application the final c++ dll and .net dll containing the business logic code will be separate entities and the ones who want to get to your business logic would still be able to just pick out the .net dll and peek inside.
you might want to consider Remotesoft Salamander Protector
this is much better than anything else in that it makes it impossible to decompile to the high level language.
Of course, anybody who is an expert can spend enough time with your software and figure it out because it does decompile some,but it hides all the set and get methods
So, they can get a peak,but that is about it. they have to figure out the rest which lowers the probability of anybody just cracking it.
hope this helps
Writing on this thread after a long time. We have purchased a software called Intellilock which is helpful in preventing decompilation, obfuscation and also has a strong licencing module.
We did not go for .Net Reactor even though it has more prevention controls as Intellilock was serving our purpose well enough.

Home Automation Library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm a C# developer looking to get into home automation as a hobby. I have done a little research, but was wondering if anyone knows of a good .NET library that supports Insteon hardware. I'd rather use Insteon than X10 due to reliability issues.
My ultimate objective at this point is to have a simple home automation server (maybe lights and climate control) with a secure ASP.NET web application interface. I'm more interested in actually building it and learning about it rather than finding an existing solution.
Thanks for any suggestions or comments.
Edit:
Thanks for the help, everyone.
Does anyone have experience with Z-wave technology? Seems promising - appears to be higher quality hardware, includes a core library, supports .NET, etc. ControlThink appears to have a pretty good controller and SDK.
Here's an interesting application to consider: Stall Status: Know Before You Go
We found there really wasn't much developer support for Insteon unless you wanted to buy their SDK and agree to their rather heavy-handed license agreement. Rather than go that route, we wrote our own .NET library called FluentDwelling and we open-sourced it. You can find a download link, and some get-you-started code samples if you follow that link.
The source code comes with a full suite of unit tests (requires NUnit, also free), so you can add improvements and make changes if you like.
I would avoid X10 like the plague. Between things like modern TV's and power strips, bridged power junction boxes and just plain strange wiring, X10 signals tend to just "disappear" and never get to their destination.
If you really want to give X10 a shot, I've got a box of X10 stuff in the garage that was worth $250+ new and it's all completely useless in my house, so you can have it. Some of it worked in my old house, but it won't so much as turn a light on 2 outlets away where I live now.
X10 is viewed by most modern electronics as "noise" on the line (which, technically, it is) and something to be filtered out rather than passed along or left alone.
I can't remember if it covers the specific technologies you mention but you should definately check out this episode of .NET Rocks. They talk about all the different stuff you can do with home automation and a lot about how to do it. I believe one of the main points was that Microsoft Robotics Studio was a good tool to use, as it uses a lot of the same abstractions as you would otherwise use.
I know it's been a long time since this post was made, however I was wondering if you'd picked a route, and what you've ended up doing with home automation since.
I've been doing this kind of stuff with many of the technologies available, but I've always done it on top of a product called homeseer. .net plug-ins and vb.net and c# scripting can be done on top of this foundation. I've been thinking of rolling my own similar to what you were describing. Any thoughts, tips, decisions you've made etc?
A bit off topic, but listen to the latest episode of dot net rocks, one of the finalists of my .net story built an home automation solution that really made me want to dive into home automation again.
Totally awsome solution.
http://www.dotnetrocks.com/default.aspx?showNum=518
I think this would bee a place to start
insteon sdk
Some research via Google looking for an Insteon SDK only yields stuff from way back in 2005. There's only information on serial port interfaces (no USB) and the only language mentioned is something called DockLight scripting that also looks like it hasn't been updated since 2005.
X10, on the other hand, boasts support for C++, VisualBasic, VB Script, and JavaScript. No .Net listed, but VisualBasic/VB Script likely implies a COM object you can easily import for use in C#. They're also much more USB friendly, and the kit costs 1/4 of the Insteon kit ($50 vs $200).
If you were actually building a product I would understand the reliability concern. But since this is a home project I think you'll have much better luck with X10.
you can try C-bus by Clipsal(schneider) it's free.

Categories

Resources