From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from resqmta-ch2-07v.sys.comcast.net (resqmta-ch2-07v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:39]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 90AD077889 for ; Tue, 23 Jul 2019 13:53:41 -0700 (PDT) Received: from resomta-ch2-17v.sys.comcast.net ([69.252.207.113]) by resqmta-ch2-07v.sys.comcast.net with ESMTP id pzA1hYC9n544Sq1n0h3Pet; Tue, 23 Jul 2019 20:53:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1563915218; bh=783GlxPIjqZDmuCKd+y8a8nn41RLn1Ka6mIwxkFBz+o=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=PLcVnsbMO2MlfUX5rPv1h68Gsc7XsispJmjbidMlrqWLm4p3gw+hSvKKBieaKfh5Z zrxwvcfokSARmQChAOJ3AlSip/vHv/4d02CnLhhy6KK2A+i/6/CrVvyggRlliQs/6J 3ywWJ8CedptxAPqcMmwY7R4w3fayFKxhUzzn4/LYy6QFL07GeVbxTbu5nlrOI/Hkvw uOfOckgSCorC6OHE7slQILdExwp7CyyayMsg5pzbZGrSkI1PU1B9uNMYH81EAbovWw O0lsmSrXM5Ijo0iFzT3sDZw85JqD4OC8jg/OcojCBA7GlXwRsx5iad4qh7giiNRUUv uV/taXD4jd84A== Received: from unknown ([IPv6:2601:408:c303:3f49:21e:4fff:fec2:a0f1]) by resomta-ch2-17v.sys.comcast.net with ESMTPSA id q1mxh5gWxIjJEq1myhZ1AL; Tue, 23 Jul 2019 20:53:36 +0000 X-Xfinity-VMeta: sc=0;st=legit To:edbrowse-dev@edbrowse.org From: Karl Dahlke Reply-to: Karl Dahlke User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Subject: [edbrowse-dev] If you Give a Mouse an Unsubscribe Link Date: Tue, 23 Jul 2019 16:53:35 -0400 Message-ID: <20190623165335.eklhad@comcast.net> X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=nextpart-eb-590448 Content-Transfer-Encoding: 7bit This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --nextpart-eb-590448 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lord it's been a wild 5 weeks. I got a spam email with an unsubscribe link, so I clicked on it, and it was very js intensive, 20 thousand lines of js I would learn = later, and it didn't work. Well ok that became a project. I made a local copy of the website, deminimized, with my trace points = injected. There was at least a week of work implementing these trace points and = breakpoints in a way that would not disrupt the syntax or semantics of = the code. So now I have something to trace through, but I noticed the web page = produced an error with my trace points in, that was not there without = the trace. As you know from any symbolic debugger, break points should not change = the flow of execution!! And yet it did. It took another week or more for me to disentangle this mess from = edbrowse and build a js only example of the phenomenon. I sent it to Sami, saying it was his bug, but he couldn't reproduce it. He tried several ways but couldn't reproduce it; meantime I had = reproduced it on 3 different machines. We finally determine the bug does not appear when duktape includes some = debugging features. Those features are stripped out by the various distributions. That is typical; end users don't debug, so distribute the programs as = lean as possible. But it was a bit ironic; his users might run into this bug, but he = never would, and in fact he would have to debug the bug without the debugging = features. Well Sami is a world class programmer so in a few days he pushed the = fix. I pulled the latest duktape and rebuilt edbrowse and confirmed the fix. Now I was back in the saddle again. I could trace execution and insert breakpoints and that would not = change the flow. Many days of tracing and I finally realized I was missing some data, = because an xhr request failed with 404. That is because they were setting some special headers on xhr and I = wasn't passing them to curl, in fact I was ignoring them altogether. Once I made this connection the xhr call worked, and I got the json = data I needed, but still the form didn't work. More tracing and I realized there was a document.onchange handler that = was never called. Turns out every input in a form is suppose to trigger an oninput event = and an onchange event, and an onclick event if it is checkbox or radio. I was doing the onclick but never even thought about oninput or = onchange. I made this connection (latest commit) and now the unsubscribe form = works. Hopefully I won't get any more email from them. Wow! Debugging edbrowse is not for the faint of heart. Karl Dahlke --nextpart-eb-590448--