edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] XMLHttpRequest
Date: Tue, 27 Dec 2016 18:26:20 +0000	[thread overview]
Message-ID: <20161227182620.GA8364@odin> (raw)
In-Reply-To: <20161127111251.eklhad@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 2731 bytes --]

On Tue, Dec 27, 2016 at 11:12:51AM -0500, Karl Dahlke wrote:
> Since almost the dawn of html, <frame> and <iframe> can cause a browser
> to fetch other html, perhaps from another domain, and paste the result into the web page.
> In this regard edbrowse is more manual than any other browser; you have to click on a link to fetch in the frame.
> Not saying I like it that way, I don't, it was just easier at the time.
> Anyways other browsers just do it, without worrying about security,
> I don't think XMLHttpRequest is any different; except js is directing the http fetch,
> and perhaps using the result in some computational way,
> rather than html directing the fetch and browsing the result.

Actually that's not quite correct.  What browsers usually do is use something
called CORS (cross origin resource sharing) to decide whether a particular
request is ok.

The implementation is a bit complicated but it's basically based on http headers
telling browsers whether access to a resource is allowed.  Specifically this
applies when a request is cross-domain or cross-protocol i.e. from
edbrowse.org to eklhad.net or https to http.

This is important to prevent cross-site scripting attacks and there are a
bunch of systems which implement this.  I don't have the relevant links to hand
but there's lots of documentation on the internet about various browsers'
implementations.  I think there's some kind of standard also.

> Most of the time even js just slaps the html into a <div> where it is browsed;
> just a damn fancy complicated, and dynamic, form of iframe.
> I'd be surprised if a js fetch had to draw from the same domain, but it might, IDK.
> Maybe write some test code and run it on other browsers.

It's actually quite a mixed picture as far as that's concerned.  There're a lot
of AJAX requests cross-domain (using preflite OPTION method requests to set up
CORS stuff) but there're also a bunch of systems I'm aware of using same-origin
AJAX requests for server-generated dynamic content.

> By the way, we should think about expanding all these frames and iframes, as other browsers do,
> but it's more work than first appears.
> The top half of your "buffer" is this tree from this html on this domain running this instance of js,
> and the bottom half of your buffer is that tree from that html on that domain running that instance of js,
> so multiple js windows tied to one edbrowse window, which we can't do now, etc etc.
> definitely some work there; for now an improved dom and jquery is more important.

Agreed.  Though it'd be good, if we ever do this, to mark the frames somehow.  I
*think* js may have access to these frames somehow but I'm not sure what the DOM
looks like for this.

Cheers,
Adam.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2016-12-27 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-27 16:12 Karl Dahlke
2016-12-27 18:26 ` Adam Thompson [this message]

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=20161227182620.GA8364@odin \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /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).