Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn’t detect inline scripts in XHTML(5) documents #2

Open
Columbus240 opened this issue Jan 20, 2020 · 1 comment
Open

Doesn’t detect inline scripts in XHTML(5) documents #2

Columbus240 opened this issue Jan 20, 2020 · 1 comment

Comments

@Columbus240
Copy link

Columbus240 commented Jan 20, 2020

If a webpage is served as application/xhtml+xml (and is well-formed), then LibreJS won’t detect or block blocks of inline JavaScript.

Minimal example:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Some Title</title>
</head>
<body>
	<script>console.log("Hello");</script>
</body>
</html>

If this is saved to a *.html file and opened or served as text/html, LibreJS will note the inline script as trivial. If it is saved to a *.xhtml file and opened or served as application/xhtml+xml LibreJS will ignore the inline script.
The JavaScript above can be replaced with arbitrary JavaScript code without LibreJS changing its behaviour.

Edit: If an inline <script> element is inside the <head> instead of <body> it will also be ignored. So this doesn’t influence it.

@bill-auger
Copy link
Contributor

bill-auger commented Jan 20, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants