From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out.smtp-auth.no-ip.com (out.smtp-auth.no-ip.com [8.23.224.60]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 4B15577CED for ; Wed, 7 May 2014 15:28:24 -0700 (PDT) X-No-IP: carhart.net@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from carhart.net (unknown [99.52.200.227]) (Authenticated sender: carhart.net@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 0506D9B2F00 for ; Wed, 7 May 2014 15:27:41 -0700 (PDT) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id s47MReiW031247 for ; Wed, 7 May 2014 15:27:40 -0700 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id s47MReDA031244 for ; Wed, 7 May 2014 15:27:40 -0700 Date: Wed, 7 May 2014 15:27:40 -0700 (PDT) From: Kevin Carhart To: Edbrowse-dev@lists.the-brannons.com Message-ID: User-Agent: Alpine 2.03 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: [Edbrowse-dev] jQuery X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 22:28:24 -0000 Hello - I am Kevin - I appreciate being able to lurk on the list for a while. I have been waiting to post til I had something salient to post about. I might finally have something to contribute on this. I have briefly corresponded a bit with Karl and Chris from time to time, as far back as 2008. As the edbrowse docs put it, "many sighted users have taken advantage of the unique scripting capabilities of this program, which can be found nowhere else," and this is my background with the program. I love it. edbrowse got me thinking about JS in a different way. As I have used edbrowse on scripting jobs that I do professionally, I have set aside mysterious web pages that didn't work in edbrowse. One is yellowpages.com. Another is alabamaconnect.gov, which I once had to script and banged my head on. I set these sites aside to go and investigate some day and recently I have finally put some time into it. I'm not sure if this is obvious or if you have discovered this already, Karl, Chris, Adam, et al, but I think one big reason that a page behavior doesn't work in edbrowse that we might be able to do something about is event handlers that cannot be picked up by handlerPresent and handlerGo. For some of these handlers, the problem is joined at the hip with jquery. We would need to unravel the jquery representation of the handler, and get into the plain javascript that the jquery is a wrapper around, in order for handlerPresent to find and process that handler. As you may already know, jquery has a concept called selectors. They have come up with a variety of ways of slicing up and returning a subset of the elements from a hierarchical web page. jquery has feature-itis..it allows lazy designer/developers to avoid having to learn the deeper level by just calling a toy with a million features. (But I mostly use interpreted, garbage-collected and scripting languages, so I am one to talk... (smile) ) So maybe a given web page has a selector that says: $(select elements whose title contains 'e').onClick ( alert 'something'); I am not yet clear on how this is evaluated and what happens to the onClick. If there are 7 elements that satisfy the selector condition, is the onClick doled out to each of the 7? It must be stored somewhere.. the holy grail for me has been how can I tell handlerPresent where to find this? And how can I do it in a generic way that doesn't just accomodate the hot library of 2014 but will keep on working when something else gets fashionable. I think getting this to work is wrapped up with getting more DOM into edbrowse. I have done some hacking on this by bringing in an existing library called env.js. It might potentially be a way to implement a DOM in edbrowse without having to implement the spec from scratch. Or it could introduce a lot of trouble of its own and be no good, but on an experimental basis, I have played with it to see how far I could get. If I want to implement certain event handlers, I need jquery, and if I need jquery, I need a DOM. env.js is intended for use with Rhino, but I have struggled to get it to work with Spidermonkey. I have it partially working. I think some selectors use regular expressions and others make heavy use of the standard getElementsByTagName and getElementByID under the hood. This is where I am right now. It's a bit tricky. I know you all have implemented gEBI and gEBTN by using document.all and document.idMaster -right? - , but I have had problems reconciling the window.document that is pumped in from jsdom.c, with something that needs to be a Node and have childNodes. Because the javascript implementation of document.getElementsByTagName that I have been using expects to be passed something with .childNodes and be able to traverse a node tree recursively in order to match at lower-down levels. I hope this makes sense- the long and short of it is that if we want to implement selectors, we might be able to tell handlerPresent about a lot more handlers that are currently concealed, and hopefully this would mean a chunk of new pages that would work in edbrowse. thanks; good to be in contact with you all, Kevin ---------- Forwarded message ---------- Date: Wed, 7 May 2014 12:52:25 From: Karl Dahlke To: Edbrowse-dev@lists.the-brannons.com Subject: [Edbrowse-dev] jQuery My first foray into jquery has me shaking my head. https://learn.jquery.com I downloaded jquery-1.11.1.js, and at least it is real code, not minimized. But what is the point? It reminds me, decades ago, a proff showed me how you could use the preprocessor to almost turn C into pascal. #define begin { #define end } etc And then he said, "but don't ever do that!" jquery seems to be a huge library of functions that overlay prototypes and all sorts of things to make js more powerful I guess. If we have a perfect js dom implementation then jquery would run just fine, but we don't. My first load of the library gives this error. jquery-1.11.1.js: 916: TypeError: document is undefined Really? almost the first thing I do in createJavaContext is make the document object. It's there from the start, but somehow something in this library has caused it to disappear. I haven't had the time or the inclination to track down what has happened. Karl Dahlke _______________________________________________ Edbrowse-dev mailing list Edbrowse-dev@lists.the-brannons.com http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev