edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Kevin Carhart <kevin@carhart.net>
To: Adam Thompson <arthompson1990@gmail.com>
Cc: Chris Brannon <chris@the-brannons.com>,
	Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] XHR
Date: Sat, 19 Dec 2015 15:40:32 -0800 (PST)	[thread overview]
Message-ID: <alpine.LRH.2.03.1512191508290.22362@carhart.net> (raw)
In-Reply-To: <20151218141232.GB2770@122oven.adamthompson.me.uk>

>
> I don't personally have an account but,
> since I've ended up with more time than I expected,
> I'm beginning to think that getting a somewhat functional XHR object is more
> pressing than a js engine switch.
> As such, are there any incremental steps we can take which will get us at least
> a basic XHR object which don't require rewriting (or duplicating using an async
> design) Edbrowse's comms layer?

I have some code, but I'm not sure if you will be able
to use it or not.  I managed to get a little further with
some sites by giving it a crude S-JAX.

Currently in startwindow.js we have a stub of an XMLHttpRequest:

XMLHttpRequest = function(){
     this.headers = {};
     this.responseHeaders = {};
     this.aborted = false;//non-standard
};

But off in my not-yet-submitted code, I have an
implementation of open:

     open: function(method, url, async, user, password){

And also of 'send'.  To do the HTTP, I hooked it up with a
simple curl call back in the C++ file.  It accepts
parameters, it runs a request-response, and returns
the output to a javascript variable.  Probably insecure!
It is not intended for the robust edbrowse in its
current form.

So it's a preliminary stab, which doesn't yet have
two massive things, (a) to be asynchronous and
(b) bringing your response back to the edbrowse
tree (if needed - I thought maybe the process of
how to splice the new XHR response text back into
the tree on the JS side would cover it, because
then our existing side effects would take it back
to the edbrowse tree)

All it is right now is a side HTTP getter which
does not work as a continuous DOM splicer, but
executes a second GET/POST, puts the resulting
"raw material" in a variable and leaves it up
to you to do something with it.

Maybe the incremental steps of which you speak
would be to do some of this, only well.  :)

Kevin











This duplicates http.c,
but I didn't know how to get back to the C code.

And of the send method.  And for the HTTP action, I
just wrote something that works like other native implementations
of a javascript keyword.  It just accepts the appropriate
parameters and calls curl.

And of the send method, where all I did was redundantly
bring over a routine that can call curl, into jseng-moz.





>
> Cheers,
> Adam.
>

--------
Kevin Carhart * 415 225 5306 * The Ten Ninety Nihilists

  reply	other threads:[~2015-12-19 23:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 13:46 [Edbrowse-dev] Non-technical rant Chuck Hallenbeck
2015-12-17 14:52 ` Chris Brannon
2015-12-17 15:31   ` Karl Dahlke
2015-12-17 16:26     ` Chris Brannon
2015-12-17 20:56       ` [Edbrowse-dev] alt.ensign.crusher.die.die.die Kevin Carhart
2015-12-18 14:12         ` Adam Thompson
2015-12-19 23:40           ` Kevin Carhart [this message]
2015-12-21 23:29             ` [Edbrowse-dev] XHR Adam Thompson
2015-12-22  3:44               ` Kevin Carhart
2015-12-22  4:13                 ` Kevin Carhart
2015-12-22 15:28                 ` Karl Dahlke
2015-12-22 20:04                   ` Kevin Carhart
2015-12-23 18:52                     ` Adam Thompson
2015-12-17 21:00 ` [Edbrowse-dev] Non-technical rant Kevin Carhart
2015-12-17 21:38   ` [Edbrowse-dev] masking of passwords Kevin Carhart
2015-12-17 21:55     ` Chris Brannon
2015-12-18 13:58       ` Adam Thompson
2015-12-18 15:13         ` Karl Dahlke
2015-12-19 23:55           ` Kevin Carhart
2015-12-17 22:13     ` Karl Dahlke
2015-12-18  0:00       ` Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.03.1512191508290.22362@carhart.net \
    --to=kevin@carhart.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=arthompson1990@gmail.com \
    --cc=chris@the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).