-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathPopupTest.html
More file actions
53 lines (46 loc) · 1.86 KB
/
Copy pathPopupTest.html
File metadata and controls
53 lines (46 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Popup Test</title>
</head>
<body>
<a href="https://github.com/CefSharp/CefSharp" target="_blank">target=_blank</a>
<br />
<a href="#" onclick="window.open('https://github.com/CefSharp/CefSharp')">window.open()</a>
<br />
<a href="#" onclick="window.open('custom://cefsharp/BindingTest.html')">BindingTest.html</a>
<br />
<a href="#" onclick="window.open('custom://cefsharp/MultiBindingTest.html')">MultiBindingTest.html</a>
<br />
<button id="openMyWindow">Open "myWindow"</button>
<button id="closeMyWindow">Close "myWindow"</button>
<script>
var myWindow;
document.getElementById('openMyWindow').addEventListener('click', function (e)
{
myWindow = window.open('/HelloWorld.html', 'Popup WindowName', "menubar=0,resizable=1,location=0,status=0,scrollbars=1,width=640,height=480");
try
{
myWindow.darkTheme = false;
myWindow.addEventListener('DOMContentLoaded', (event) =>
{
myWindow.document.write("<title>Foo Title</title>");
myWindow.document.write("<body>This is the new body</body>");
myWindow.document.close();
//myWindow.document.title = "Foo Title";
//myWindow.document.body.innerHTML += "<br/>Appended to document body";
console.log('Popup body and title updated:', myWindow.document.body.outerHTML);
});
}
catch (e)
{
console.log('popup error', e);
}
});
document.getElementById('closeMyWindow').addEventListener('click', function (e)
{
myWindow.close();
});
</script>
</body>
</html>