On Thu 2022-10-13 10:53:25 -0400, bill-auger wrote:
> this is an exemplary case for unit tests - rather than adapting
> to arbitrary examples found "in the wild", to contrive a set of
> minimal examples which have the properties that need to be
> accounted for, then to write tests that assert the program's
> desired behavior on the known examples
>
> <!DOCTYPE html>
> <html><body>
>
> <script>console.log("trivial script")</script>
> <script>eval('console.log("non-trivial script")')</script>
>
> <noscript>
> inside a noscript
> <script>console.log("is this logged?")</script>
> <script>eval('console.log("non-trivial noscript")')</script>
> </noscript>
>
> </body></html>
>
> to answer the previous mystery, yes that <noscript><script>
> runs with librejs enabled - both 'eval()' are blocked as ecpected
>
> rendered:
>
> inside a noscript
>
>
> logged:
>
> trivial script
> is this logged?
That's a nice test case, would you like to add it to the existing tests,
and send a patch or push the change to a non-master branch? There's one
test does something similar[1] but it does not test that scripts under
<noscript> can be blocked.
[1]
https://git.savannah.gnu.org/cgit/librejs.git/tree/test/spec/LibreJSSpec.js#n261
Best,
Yuchen
--
PGP Key: 47F9 D050 1E11 8879 9040 4941 2126 7E93 EF86 DFD0
<https://ypei.org/assets/ypei-pubkey.txt>