From: Kevin Carhart <kevin@carhart.net>
To: edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] var elem = document.querySelector('script[nonce]');
Date: Tue, 26 Sep 2017 16:48:52 -0700 (PDT) [thread overview]
Message-ID: <alpine.LRH.2.03.1709261629500.4230@carhart.net> (raw)
In-Reply-To: <20170826081450.eklhad@comcast.net>
> 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
prev parent reply other threads:[~2017-09-26 23:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 6:18 Kevin Carhart
[not found] ` <20170826081450.eklhad@comcast.net>
2017-09-26 23:48 ` Kevin Carhart [this message]
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=alpine.LRH.2.03.1709261629500.4230@carhart.net \
--to=kevin@carhart.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).