How to implement a debugger for the debugging web - google-chrome-devtools

How to directly implement a debugger for the debugging web
I want to implement a debugger myself to create a web that can be debugged.
The reason is that we want to implement a debugger that has only simple usage for beginners. So I want to implement the start, step in, step out button, variable, watch, scope simply.
but, I'm student.. Can anyone suggest a good way to implement the debugger? Please recommend sources or materials to refer to how to implement.
The languages you can speak are JavaScript, React, Nodejs, and Express.
From what I've searched now, it's still a novice to take advantage of Chrome DevTools Protocol, Chrome DevTools Client, awesome-chrome-devtools, and I don't know how to implement it.

Related

Can I use webassembly for plugins like blender uses python?

I was talking to a friend of mine who knows a lot about js and wasm.He told me the technology goes far beyond web, since it is basicly a way to run near native applications on devices without actually giving them access to the computer.
Which means that thrid party or untrusted code on a smartphone for instance cannot accidentally or intentional change other apps or parts of the system.
This seamed to me like the perfect conditions to build a plugin system for an application I am working on.
I asked him about it but he was unable to give me a clear answer.
So the question is, can I use webassembly outside of a webbrowser, with custom bindings to safely allow users to extend the functionality of my application (a special image viewer) without sacrificing too much speed? It seams it should work using libnode or something, but is there a problem I might run into?
I don't know how much you know about web assembly but it depends on what your plugins actually should do. If it basically handle Arrays and numeric data with not that match interacting with host applications then it might fit. But when you have heavy object handling then it will not fit at the moment. So for image processing it might be perfect match like it is used in some web examples. Also be aware that some web assembly targeting system or not suitable for none web targets as they generate also some javascript code to be used in browsers beside the generate wasm. Some wasm modules for example require that you call malloc and free for string handling other have functions like new and gc for the nearly the same.

Interaction between browser and external hardware?

I'd like to know what are the different ways for a browser to interact with external hardware.
Something important : I have control over the machine. That means I can install addons( firefox, chrome ), and run exes on the machine.
I already have a JAVA program that can communicate with the hardware, and I'd like to know how to expose the interface to the browser. So that's one possibility I'm investigating but I'd like to know if there is any other way I can do it.
Thank you
I had a similar problem. The only ways presented were to either use an addon, or write use a tiny C server that uses HTML as it's GUI.
I know you are using Java, and this thread is C++ related, but the basic principles should still work: link here.
You can expose a COM interface from your java application and use silverlight to talk to it. This is significantly simpler if the desktop application is in .NET. Check out: http://www.wintellect.com/CS/blogs/jprosise/archive/2009/12/14/silverlight-4-s-new-com-automation-support.aspx
HTML5 will have a device element that will allow you to connect external devices. Right now, the only choice you have is using plugins to communicate to external hardware.
You can search about NPAPI (a new api called PPAPI is in the making) that will allow you to create a plugin that communicates to native code to do whatever you want.

drag and drop workflow kind of interface..how easy to develop?

How easy it's to come up with a drag and drop web-based interface that'll provide me features to wire objects together, setup configurations nicely in a modal window for each object? I'm looking for links that've any similar kind of interface, or articles on this. also, i'm looking for your technology/language suggestions.
Another way I'm thinking - as a desktop appln + browser dependent addon..
Is it good to create such an user-interface using XUL, which can be deployed as an addon on Firefox/as a stand-alone application in Windows? Are there any other similar things/technologies which can provide a basic framework for us to build on it further?
Why do I need this, finally?
..for building simple Workflows, for defining process flows, that can provide me some auto-generated xml content which I can use for further processing.
Thanks!
I'm quite interested in this, too.
I've flirted with HTML5's DragDrop implementation - Quirksmode has Bad Things to say about that, so then I thought "Perhaps a JavaScript library can help me" - haven't checked out jquery for this yet, but I have checked out YUI's DragDrop, DragDropManager and DataSource, and its looking hopeful (consistent, reliable).
I tried things like adding an iframe on the fly to any document, to provide this kind of functionality without needing to add dependencies to the page given the iframe - mixed results, but in my case I was trying to cater for x-domain access, which proved difficult.
So I'd say JavaScript could be a winner - if designed poorly it could be difficult to manage resources though, if you want to potentially DragDrop/edit/config any element in a document - so watch out for that.
If you're keen and able, Adobe AIR apps also look promising - but I can't help with any more info on that, other than they're Desktop Apps with great flexibility.
I'ma going to keep an eye on your Question, I look forward to any other Answers/comments!
EDIT: I forgot to mention Flex (aka Flash Builder 4, latest version) is quite easy to create stuff like this, though I've had exposure to Flash for a while. It comes with the standard Adobe caveats; price, libraries, support.

http client that executes javascript...?

Does anyone know of an http client that is scripting friendly (ie: the basics, gets, posts) and is capable of executing javascript (all, not just location redirect) ? And one which isn't just launching another browser.
There are now tools to achieve exactly what you are asking. The best class of tool, if not the only one, is probably the "headless-browser".
There have apparently been a few attempts at headless browsers, but the one that seems to have got it right is called PhantomJS.
PhantomJS is basically a WebKit browser without any display, so all the layout logic, JavaScript, etc is all in there along with the basic HTTP client, just like in a browser - because it is a browser.
PhantomJS exposes some kind of interface in JavaScript but apparently it's not so easy to use on its own. Another project has popped up to make it more useful, CasperJS.
One more project deserves mention here, SpookyJS. It's job is to act as a middleman between node.js and PhantomJS, since both implement a JavaScript event loop it's not easy to integrate them. With SpookyJS you can script a HTTP client in JavaScript on your desktop or server.
As far as I know there is no such thing available (although I'm keeping an eye on this thread hoping to be proved wrong).
However if your prepared to roll up your sleeves and do some work, then it should be possible to implement sucah a thing based on Firefox with a xul script - or you might consider looking at, for example, rhino - which is a javascript engine without a browser.
Elinks is a text-mode browser with javascript - so it would probably be simpler to run that in a pty compared with implementing your own browser component and exposing the DOM to rhino.

Is there a scala version of Python's Mechanize?

I have used mechanize in Python with great success. However, I am trying to learn Scala. I have an IRC bot that I would like to add some features to, mostly having to do with screen scraping web pages from our corporate intranet. That requires being redirected to a corp-wide login page, then going to the destination, then having to possibly submit another login.
Does anyone know of something that I can use from Scala to get this sort of functionality?
I don't know any Scala effort of similar functionality. Pending answers to the contrary, I advise you to look for Java libraries of similar functionality.
The closest Java libraries I can think of are browser drivers. The most well-known are Selenium and WebDriver. The latter also offers an in-process mode.
Since Selenium's API isn't all that pleasent to use, a couple of projects sprung-up with DSLish façades: Selenium DSL and Selenium Inspector.
A caveat is that they are all oriented towards testing of web application, so they might be lacking in features that attend your case.