edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] how about wrapping style placement in try-catch?
@ 2017-09-27  4:01 Kevin Carhart
  2017-09-27 10:48 ` Karl Dahlke
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Carhart @ 2017-09-27  4:01 UTC (permalink / raw)
  To: edbrowse-dev



amazon has a problem with a small handful of style placements, like 5 out 
of hundreds.  When it bails out with a runtime, it neglects to process 
others that might be able to do successfully.  This might be true for 
other sites besides amazon too.

What do you think of the idea of wrapping
if(!t.style[propname])
t.style[propname] = propval;

in a try-catch block?

Note about the root cause:  Diagnosing the root cause would be another 
way to go.  I think the cause has something to do with form 
options.  querySelectorAll("#navbar #nav-search .nav-search-dropdown") 
reports that the length of the resulting set is 1, yet if you echo it from 
jdb, there are about 50 elements in the resulting set.  And it can't get a 
handle on .style for some reason.  It seemed like, given result set rs, 
rs.style did not exist,
and 
rs[0].style did not exist,
but
rs[0][0].style did exist.  After I put some time into diagnosis, I 
thought "this is taking a while for one style... if the issue is obscure, 
we could just skip a few by using try-catch.."  As we do currently
with a few pseudos.



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

* [Edbrowse-dev] how about wrapping style placement in try-catch?
  2017-09-27  4:01 [Edbrowse-dev] how about wrapping style placement in try-catch? Kevin Carhart
@ 2017-09-27 10:48 ` Karl Dahlke
  2017-09-28  3:45   ` [Edbrowse-dev] amazon Kevin Carhart
  2017-09-28  3:48   ` [Edbrowse-dev] how about wrapping style placement in try-catch? Kevin Carhart
  0 siblings, 2 replies; 6+ messages in thread
From: Karl Dahlke @ 2017-09-27 10:48 UTC (permalink / raw)
  To: edbrowse-dev

Instead of try catch I created the style object, if it was missing, and also log that it is not there.
console.warn is nice because it's like debug print at level 3, from the js side.
Regular users won't see it.
Amazon only shows one missing style, from the Select object.
This is definitely more informative.
I'll follow up on that root cause later, meantime you should be able to advance.

I'm thinking about bumping the "execute timer" messages from db3 to db4, because timers can fire repeatedly,
and db3 is suppose to look for the presence or absence of problems,
not all the information you need to fix them, so would be nice if level 3 was quiet once the page was browsed,
unless of course there are problems.

Karl Dahlke

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

* [Edbrowse-dev] amazon
  2017-09-27 10:48 ` Karl Dahlke
@ 2017-09-28  3:45   ` Kevin Carhart
  2017-09-28  4:58     ` Karl Dahlke
  2017-09-28  3:48   ` [Edbrowse-dev] how about wrapping style placement in try-catch? Kevin Carhart
  1 sibling, 1 reply; 6+ messages in thread
From: Kevin Carhart @ 2017-09-28  3:45 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: edbrowse-dev




> Instead of try catch I created the style object, if it was missing, and also log that it is not there.

Thank you.. the homepage of amazon now reports no errors at all!
The login page still reports a couple.  Logging in doesn't work yet.

There's something quite remarkable.........
If you want to experience this for yourself, do this..
b http://amazon.com
11
{the line with the login link}
demin
g2
{Now the login page is loaded}
jdb
showscripts()
{scripts[9] is the big one. either echo document.scripts[9].data or export 
it to a file}

This code, called fwcim._CB516154953_.js, is impressively obfuscated.  Not 
something you run across every day.  I hope we will be able to just point 
edbrowse at it and will not need to think about its inner workings, unless 
anyone knows about deobfuscation or has the appetite for a huge 
substitution cipher:

                             var _z2sz = function (_Zs$2, _iLLLl, _111LI) {
                                 var _ooO0O = [
                                     'FwcimObfusca',
                                     'nod',
                                     'te',
                                     'hBStatement',
                                     'has',
                                     'e',
                                     39801
                                 ];
                                 var _ZS$2z = _ooO0O[1] + _ooO0O[5] + 
(_ooO0O[0] + _ooO0O[2]), _2szSs = _ooO0O[6];

There is more to do here.. I've just been reading a blog post by Ricky 
Lalwani, who has succesfully done just what we are trying to do.  The 
problem involves an http request variable called 'metadata1', which is 
generated on the fly.  And a remarkable amount of work goes in to building 
this thing.

https://ricky.lalwani.me/programming/logging-in-to-amazon-part-2/

So the good news is that others have tried to log in to amazon over http 
tools.  The bad news is that it appears to be an industrial strength 
challenge..


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

* Re: [Edbrowse-dev] how about wrapping style placement in try-catch?
  2017-09-27 10:48 ` Karl Dahlke
  2017-09-28  3:45   ` [Edbrowse-dev] amazon Kevin Carhart
@ 2017-09-28  3:48   ` Kevin Carhart
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Carhart @ 2017-09-28  3:48 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: edbrowse-dev

>
> I'm thinking about bumping the "execute timer" messages from db3 to db4, because timers can fire repeatedly,

Good idea.  It makes sense.  db3 becomes too hard to read with the timers 
going.

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

* [Edbrowse-dev] amazon
  2017-09-28  3:45   ` [Edbrowse-dev] amazon Kevin Carhart
@ 2017-09-28  4:58     ` Karl Dahlke
  2017-09-28  6:45       ` Kevin Carhart
  0 siblings, 1 reply; 6+ messages in thread
From: Karl Dahlke @ 2017-09-28  4:58 UTC (permalink / raw)
  To: edbrowse-dev

Well if amazon is too much bloody work, then we should turn our attention elsewhere.
Personally, I buy about 3 things from amazon a year, at Christmas, and there's no trouble having my wife do it for me.
I just mention it as a popular ecommerce site, but there are many others.
Any retail chain, for instance, or ebay, you know.

Karl Dahlke

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

* Re: [Edbrowse-dev] amazon
  2017-09-28  4:58     ` Karl Dahlke
@ 2017-09-28  6:45       ` Kevin Carhart
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Carhart @ 2017-09-28  6:45 UTC (permalink / raw)
  To: edbrowse-dev



True.. this may be.. I think it will be worth it for a while yet.. well 
hey, either way, we got freecarrierlookup!  Not bad, huh?!



On Thu, 28 Sep 2017, Karl Dahlke wrote:

> Well if amazon is too much bloody work, then we should turn our attention elsewhere.
> Personally, I buy about 3 things from amazon a year, at Christmas, and there's no trouble having my wife do it for me.
> I just mention it as a popular ecommerce site, but there are many others.
> Any retail chain, for instance, or ebay, you know.
>
> Karl Dahlke
> _______________________________________________
> Edbrowse-dev mailing list
> Edbrowse-dev@lists.the-brannons.com
> http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev
>

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

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

end of thread, other threads:[~2017-09-28  6:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27  4:01 [Edbrowse-dev] how about wrapping style placement in try-catch? Kevin Carhart
2017-09-27 10:48 ` Karl Dahlke
2017-09-28  3:45   ` [Edbrowse-dev] amazon Kevin Carhart
2017-09-28  4:58     ` Karl Dahlke
2017-09-28  6:45       ` Kevin Carhart
2017-09-28  3:48   ` [Edbrowse-dev] how about wrapping style placement in try-catch? Kevin Carhart

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