Showing
1 changed file
with
52 additions
and
0 deletions
helloworld.html
0 → 100644
1 | +<!-- | ||
2 | + Copyright 2021 The Kubeflow Authors | ||
3 | + | ||
4 | + Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + you may not use this file except in compliance with the License. | ||
6 | + You may obtain a copy of the License at | ||
7 | + | ||
8 | + http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + | ||
10 | + Unless required by applicable law or agreed to in writing, software | ||
11 | + distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + See the License for the specific language governing permissions and | ||
14 | + limitations under the License. | ||
15 | +--> | ||
16 | + | ||
17 | +<html> | ||
18 | + <head> | ||
19 | + <style> | ||
20 | + .message { | ||
21 | + color: #666; | ||
22 | + font-family: monospace; | ||
23 | + line-height: 22px; | ||
24 | + padding: 10px; | ||
25 | + text-align: center; | ||
26 | + } | ||
27 | + .error.message { | ||
28 | + color: red; | ||
29 | + } | ||
30 | + </style> | ||
31 | + </head> | ||
32 | + | ||
33 | + <body> | ||
34 | + <div class="error message">Hello World!</div> | ||
35 | + <script> | ||
36 | + const message = document.querySelector(".message"); | ||
37 | + message.innerText += "\nI can run Javascript."; | ||
38 | + document.addEventListener("DOMContentLoaded", () => { | ||
39 | + try { | ||
40 | + const parentCookie = window.parent.document.cookie; | ||
41 | + message.innerText += "\nWARNING! I can see parent's cookies!"; | ||
42 | + } catch (_) { | ||
43 | + message.innerText += "\nI can't see parent's cookies!"; | ||
44 | + message.classList.remove("error"); | ||
45 | + } | ||
46 | + }); | ||
47 | + </script> | ||
48 | + <noscript> | ||
49 | + <div class="error message">WARNING: I can't run Javascript.</div> | ||
50 | + </noscript> | ||
51 | + </body> | ||
52 | +</html> |
-
Please register or login to post a comment