1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<!--
|
3
|
SPDX-License-Identifier: CC0-1.0
|
4
|
|
5
|
A testing XML document with various scripts that need to get blocked.
|
6
|
|
7
|
This file is part of Haketilo.
|
8
|
|
9
|
Copyright (C) 2021, 2022 Wojtek Kosior <koszko@koszko.org>
|
10
|
|
11
|
This program is free software: you can redistribute it and/or modify
|
12
|
it under the terms of the CC0 1.0 Universal License as published by
|
13
|
the Creative Commons Corporation.
|
14
|
|
15
|
This program is distributed in the hope that it will be useful,
|
16
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
CC0 1.0 Universal License for more details.
|
19
|
-->
|
20
|
|
21
|
<fruits>
|
22
|
|
23
|
<!--
|
24
|
The following will not execute since it is not recognized as either HTML
|
25
|
or SVG script.
|
26
|
-->
|
27
|
<script>
|
28
|
window.__run = [...(window.__run || []), 'banana'];
|
29
|
</script>
|
30
|
|
31
|
<html:img xmlns:html="http://www.w3.org/1999/xhtml"
|
32
|
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg=="
|
33
|
onload="window.__run = [...(window.__run || []), 'melon'];">
|
34
|
</html:img>
|
35
|
|
36
|
<!-- Will execute -->
|
37
|
<html:script xmlns:html="http://www.w3.org/1999/xhtml">
|
38
|
window.__run = [...(window.__run || []), 'grape'];
|
39
|
</html:script>
|
40
|
|
41
|
<!-- Will also execute -->
|
42
|
<vector-graphics:script xmlns:vector-graphics="http://www.w3.org/2000/svg">
|
43
|
window.__run = [...(window.__run || []), 'raspberry'];
|
44
|
</vector-graphics:script>
|
45
|
|
46
|
<apple>
|
47
|
<svg viewBox="0 0 10 14" xmlns="http://www.w3.org/2000/svg">
|
48
|
<!-- Will run when clicked -->
|
49
|
<circle id="idaret_circle" cx="5" cy="5" r="4"
|
50
|
onclick="window.__run = [...(window.__run || []), 'idaret'];" />
|
51
|
<!-- Will *NOT* run when clicked -->
|
52
|
<circle id="nowamak_circle" cx="5" cy="13" r="4"
|
53
|
some-unknown:onclick="window.__run = [...(window.__run || []), 'nowamak'];"
|
54
|
xmlns:some-unknown="https://example.org/blah/blah" />
|
55
|
</svg>
|
56
|
</apple>
|
57
|
<!--
|
58
|
In case of wrong namespace URI (or lack thereof), svg subtree will not
|
59
|
be recognized as SVG at all
|
60
|
-->
|
61
|
<svg>
|
62
|
<!-- Will neither run nor be drawn by the browser -->
|
63
|
<circle id="mango_circle" cx="5" cy="5" r="4"
|
64
|
onclick="window.__run = [...(window.__run || []), 'mango'];" />
|
65
|
</svg>
|
66
|
<svg viewBox="0 0 10" xmlns="http://www.w3.org/2000/sv">
|
67
|
<!-- Will neither run nor be drawn by the browser -->
|
68
|
<circle id="annoying_circle" cx="5" cy="5" r="4"
|
69
|
onclick="window.__run = [...(window.__run || []), 'orange'];" />
|
70
|
</svg>
|
71
|
</fruits>
|