bug-librejs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: force display of <noscript> content


From: Yuchen Pei
Subject: Re: force display of <noscript> content
Date: Sat, 15 Oct 2022 10:11:50 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]