edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] Dynamic Scripts
Date: Mon, 29 Jan 2018 17:40:49 -0500	[thread overview]
Message-ID: <20180029174049.eklhad@comcast.net> (raw)

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

When javascript created a script using createElement, and then set its source, that script never ran.
I only ran scripts that were html. Oops.
This push fixes that, but as so often happens, it breaks (or uncovers) other things, I hope not too many other things.

It's only 60 lines of code, but complicated; took me all day to do.

There are two themes here.

1. If js sets a.href = "/foobar", then (I believe) it is suppose to resolve that against the base.
So perhaps becoming http://www.xyz.com/foobar
This happens in html, but not in pure js.
And there are 7 such members to deal with, so I wanted to fold resolveURL into the setter on the prototypes.
Thus the complexity, but I think it's working.

2. I saw that nasa creates a script from the creatElement primitive, then sets src = blah.
Such scripts never run.
Only from html would such a script run.
Created scripts from js now run.
Sadly, nasa still comes up empty, so that wasn't the answer.

As I say, it's 2 steps forward 1 step back.
With this change, amazon hangs forever.
Run with db3 and get these messages, relevant to the latest push.

js replaces script (null) with https://images-na.ssl-images-amazon.com/images/I/61ea4y7yPdL.js?AUIClients/AmazonUIjQuery
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/GenericObservableJS-c1a60b0cbfbf5d9a43a472c753b5426b6b9787a4._V2_.js#AUIClients/GenericObservableJS.secure.min
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonGatewayAuiAssets-cc30820c57e29edece019d96b11d8dcce96e13d0._V2_.js#AUIClients/AmazonGatewayAuiAssets.secure.min
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/G/01/ape/sf/desktop/DAsf-1.18._V492556619_.js?csm_attribution=APE-SafeFrame
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/G/01/ads/advertising/ads._TTH_.js?cachebust=54895310
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/G/01/ape/sf/desktop/DAsf-1.18._V492556619_.js?csm_attribution=APE-SafeFrame
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/G/01/ape/sf/desktop/DAsf-1.18._V492556619_.js?csm_attribution=APE-SafeFrame
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonGatewayHerotatorJS-0358eb038780a29b14afb6fc4a2f5730b39e5a34._V2_.js#AUIClients/AmazonGatewayHerotatorJS.secure.min
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/I/11IYhapguOL._RC|61FI-2LeF0L.js,21dmoxZTACL.js,012FVc3131L.js,31fv8bqHLoL.js,31ReKJl2X6L.js,51nK0kUyg2L.js,11+vNCgC1cL.js,01xMsWWFUQL.js,11KkQiUpBPL.js,113pP0Sfh0L.js,21auxuI+dRL.js,01PoLXBDXWL.js,612Ozn6EcSL.js,01ezj5Rkz1L.js,11SW3HEKjtL.js,01rpauTep4L.js,01rRRcQgoDL.js_.js?AUIClients/AmazonUI
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/I/01lNX6axy7L._RC|71CEni6HLCL.js,61C0EAxYIZL.js,01JS2B6NLKL.js,41jIrsqv7ML.js,01Tw08m1EFL.js,01wBjiz9OvL.js,21vYtu6vTJL.js,31AWdXGrHUL.js,51RgqN98m2L.js,31qKd4DgPkL.js_.js?AUIClients/NavDesktopMetaAsset#desktop
js replaces script (null) with https://images-na.ssl-images-amazon.com/images/I/11QXqf0G81L.js?AUIClients/RetailWebsiteOverlayAUIAssets

wow, that's 11 created scripts that were suppose to run, and didn't, but do now, but, one of them hangs forever.
We need to figure out why before we cut a version.
Meantime, I'm betting, based on the domain, that they all deal with images, and we don't care.
This seems to bring amazon.com back again.

nojs = images-na.ssl-images-amazon.com

Feel free to comment, or point out problems, or fix things that I might not have done right.

Karl Dahlke

             reply	other threads:[~2018-01-29 22:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 22:40 Karl Dahlke [this message]
2018-01-29 23:39 ` 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=20180029174049.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.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).