edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev]  Amazon can of worms
@ 2014-04-21  8:53 Karl Dahlke
  2014-04-22 14:17 ` Adam Thompson
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2014-04-21  8:53 UTC (permalink / raw)
  To: Edbrowse-dev

Adam writes:
> I think in this case it is expected that the script element is placed (and thus
> executed) in the DOM just as it would be if it was done in the html.

Perhaps, but in this case, Amazon.com, the script element is added
to the head section, which is about 1000 lines in the past.
It is not placed in some tag in the future.
Since we don't have time travle,
the best we can do is to execute the script right now.
I guess, it's all rather merky.

Karl Dahlke

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [Edbrowse-dev] Amazon can of worms
@ 2014-04-21  0:48 Karl Dahlke
  2014-04-21 11:17 ` Adam Thompson
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2014-04-21  0:48 UTC (permalink / raw)
  To: Edbrowse-dev

Ok remember when I said amazon.com had its javascript in its home page,
in modest pieces? No such luck.
I found this snip of code that tries to execute
but doesn't, because I don't have it implemented.

  var scriptElem = document.createElement('script');
  scriptElem.src = "http://z-ecx.images-amazon.com/images/G/01/s9-campaigns/s9-multipack-min._V366882549_.js";
  document.getElementsByTagName('head')[0].appendChild(scriptElem);

I am fairly certain this pulls in and executes javascript code dynamically.
But when?
When the src attribute is assigned?
When the script object is placed in the head section?
Or when that piece of javascript returns?

I really hope it's the latter.
Otherwise all sorts of code has to be reentrant.
I could stack up, actually fifo up, any such js urls and execute them
after the invoking js returns.
Not too hard to do, but it means I am missing entire swaths of js code
in amazon.com, probably in the dog vomit category,
which probably spends 90% of its time doing visual effects,
and can I really afford to spend the next 4 months trying to figure it out?

It does confirm something though: as I keep going I keep finding little
objects and methods that I just don't have implemented,
and they don't usually entail the big rewrite, they are more like enhancements,
but there are so many of them!

Karl Dahlke

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-22 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-21  8:53 [Edbrowse-dev] Amazon can of worms Karl Dahlke
2014-04-22 14:17 ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2014-04-21  0:48 Karl Dahlke
2014-04-21 11:17 ` Adam Thompson

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).