Spaces:
Running
Running
Srinivasulu kethanaboina
commited on
Update index.html
Browse files- index.html +16 -7
index.html
CHANGED
@@ -3,19 +3,28 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Gradio Chatbot</title>
|
7 |
</head>
|
8 |
<body>
|
9 |
<h1>Gradio Chatbot</h1>
|
10 |
-
<iframe src="https://srinukethanaboina-srunu.hf.space" width="100%" height="600px" style="border:none;"></iframe>
|
|
|
|
|
|
|
11 |
<script>
|
12 |
-
// Function to print cookies to the console
|
13 |
function printCookies() {
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
-
|
17 |
-
// Call the function to print cookies when the page loads
|
18 |
-
window.onload = printCookies;
|
19 |
</script>
|
20 |
</body>
|
21 |
</html>
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Gradio Chatbot with Cookies</title>
|
7 |
</head>
|
8 |
<body>
|
9 |
<h1>Gradio Chatbot</h1>
|
10 |
+
<iframe id="chatbot" src="https://srinukethanaboina-srunu.hf.space" width="100%" height="600px" style="border:none;"></iframe>
|
11 |
+
|
12 |
+
<button onclick="printCookies()">Print Cookies</button>
|
13 |
+
|
14 |
<script>
|
|
|
15 |
function printCookies() {
|
16 |
+
const iframe = document.getElementById('chatbot');
|
17 |
+
try {
|
18 |
+
// Access cookies from the iframe (may not work due to same-origin policy)
|
19 |
+
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
20 |
+
console.log("Iframe Cookies:", iframeDocument.cookie);
|
21 |
+
} catch (e) {
|
22 |
+
console.error("Unable to access iframe cookies. Possibly due to same-origin policy.");
|
23 |
+
}
|
24 |
+
|
25 |
+
// Access cookies from the main document
|
26 |
+
console.log("Main Document Cookies:", document.cookie);
|
27 |
}
|
|
|
|
|
|
|
28 |
</script>
|
29 |
</body>
|
30 |
</html>
|