1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

LibWeb: Parse <script> elements and run any JavaScript found inside

This patch begins integrating LibJS into LibWeb. Document holds the
JS::Interpreter for now, and it is created on demand when you first
call Document::interpreter().

We also add a simple "alert()" function to the global object.
This commit is contained in:
Andreas Kling 2020-03-14 12:41:51 +01:00
parent f94099f796
commit 9c9d3f0904
11 changed files with 142 additions and 3 deletions

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<script>
alert("Hello friends!");
</script>
</head>
<body>
</body>
</html>

View file

@ -23,6 +23,7 @@ h1 {
<p>This is a very simple browser built on the LibWeb engine.</p>
<p>Some small test pages:</p>
<ul>
<li><a href="alert.html">alert() test</a></li>
<li><a href="small.html">small</a></li>
<li><a href="first-child.html">:first-child</a></li>
<li><a href="last-child.html">:last-child</a></li>