From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (mailfrom) identity=mailfrom; client-ip=8.23.224.61; helo=out.smtp-auth.no-ip.com; envelope-from=kevin@carhart.net; receiver= Received: from out.smtp-auth.no-ip.com (smtp-auth.no-ip.com [8.23.224.61]) by hurricane.the-brannons.com (Postfix) with ESMTPS id E37C277DE5 for ; Tue, 26 Sep 2017 16:47:15 -0700 (PDT) X-No-IP: carhart.net@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from carhart.net (unknown [99.52.200.227]) (Authenticated sender: carhart.net@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 90B63138 for ; Tue, 26 Sep 2017 16:48:55 -0700 (PDT) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id v8QNmqZA017371 for ; Tue, 26 Sep 2017 16:48:53 -0700 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id v8QNmqSY017364 for ; Tue, 26 Sep 2017 16:48:52 -0700 Date: Tue, 26 Sep 2017 16:48:52 -0700 (PDT) From: Kevin Carhart To: edbrowse-dev@lists.the-brannons.com In-Reply-To: <20170826081450.eklhad@comcast.net> Message-ID: References: <20170826081450.eklhad@comcast.net> User-Agent: Alpine 2.03 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [Edbrowse-dev] var elem = document.querySelector('script[nonce]'); X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.24 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Sep 2017 23:47:16 -0000 > Regarding querySelect, as you see, http://freecarrierlookup.com now runs, so I don't know if this is still an issue or not. Well, in freecarrierlookup, it occurred in some pointless google code. I thought it might be necessary if the google code made the parser bail out and not run whatever is next, either. But I think this was a mistake. One slight good thing is that I think probably google ads code is modular a lot of the time, so if the parser hits a runtime, the ads code did not have crucial interoperability with the site operation. They *could* intermingle the two things but in the real world, they usually won't. Google code is being slotted in like a widget. The freecarrierlookup developer is not going to intermingle it with their own work unless they have to. So we don't need it right now. As for generally, I don't know. We could wait and see. But I think all it needs to be is something like, document.querySelector = function(x) { return querySelectorAll(x)[0] } unless you think the resource hit of selecting all just to throw away the rest would be not trivial in the case of a large tree. In that case, unlike getElements, we can't go into the recursive traversal and say "stop working once you hit the first one," because it's third party code. But if we get that far, I am pretty sure the third party code actually exposes querySelector. I seem to remember this. The single and multiple are both in MDN: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll