|
| 1 | +<!doctype html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <meta charset=utf-8> |
| 5 | + <title>CefSimple (utf-8: ąś)</title> |
| 6 | + <style> |
| 7 | + body { font: 13px Segoe UI, Arial; line-height: 1.4em; } |
| 8 | + pre { background: #ddd; font: 12px Consolas, Courier New; } |
| 9 | + </style> |
| 10 | +</head> |
| 11 | +<body> |
| 12 | + |
| 13 | +Use mouse context menu to go Back/Forward in history navigation. |
| 14 | + |
| 15 | +<h3>Google Search</h3> |
| 16 | +<a href="http://www.google.com/">http://www.google.com/</a> |
| 17 | + |
| 18 | +<h3>User agent</h3> |
| 19 | +<script>document.write(navigator.userAgent)</script> |
| 20 | + |
| 21 | +<h3>Popup</h3> |
| 22 | +<a href="javascript:window.open('cefsimple.html')"> |
| 23 | + window.open('cefsimple.html')</a> |
| 24 | + |
| 25 | +<h3>RequestHandler tests</h3> |
| 26 | + |
| 27 | +<p>See messages in the console.</p> |
| 28 | + |
| 29 | +OnBeforeBrowse() - navigate to see message: |
| 30 | +<a href="wxpython.html">wxpython.html</a> |
| 31 | +<br> |
| 32 | + |
| 33 | +OnBeforeBrowse() / OnBeforeResourceLoad() - test request.GetPostData() |
| 34 | +and request.SetPostData():<br> |
| 35 | +submit a form: |
| 36 | +<a href="https://accounts.google.com/ServiceLogin"> |
| 37 | + https://accounts.google.com/ServiceLogin</a>, |
| 38 | +upload a file: |
| 39 | +<a href="http://encodable.com/uploaddemo/"> |
| 40 | + http://encodable.com/uploaddemo/</a> |
| 41 | +<br> |
| 42 | + |
| 43 | +OnBeforeResourceLoad() - try loading nonexistent css file locally: |
| 44 | +<a href="javascript:LoadCssFile('nonexistent.css')"> |
| 45 | + LoadCssFile('nonexistent.css')</a> |
| 46 | +<script> |
| 47 | +function LoadCssFile(url) { |
| 48 | + var cssFile=document.createElement("link") |
| 49 | + cssFile.setAttribute("rel", "stylesheet") |
| 50 | + cssFile.setAttribute("type", "text/css") |
| 51 | + cssFile.setAttribute("href", url) |
| 52 | + document.getElementsByTagName("head")[0].appendChild(cssFile) |
| 53 | +} |
| 54 | +</script> |
| 55 | +<br> |
| 56 | + |
| 57 | +OnBeforeResourceLoad() - try replacing a resource on the fly: |
| 58 | +<a href="javascript:LoadCssFile('replace-on-the-fly.css')"> |
| 59 | + LoadCssFile('replace-on-the-fly.css')</a><br> |
| 60 | +(css content: body { color: red; })<br> |
| 61 | + |
| 62 | +OnResourceRedirect() - try loading this url: |
| 63 | +<a href="http://tinyurl.com/google404redirect"> |
| 64 | + http://tinyurl.com/google404redirect</a> |
| 65 | +<br> |
| 66 | + |
| 67 | +OnResourceResponse() - try loading nonexistent css file via http: |
| 68 | +<a href="javascript:LoadCssFile('http://www.google.com/404.css')"> |
| 69 | + LoadCssFile('http://www.google.com/404.css')</a> |
| 70 | +<br> |
| 71 | + |
| 72 | +OnResourceResponse() - try filtering content of the resource: |
| 73 | +<a href="javascript:LoadCssFile('content-filter/replace-on-the-fly.css')"> |
| 74 | + LoadCssFile('content-filter/replace-on-the-fly.css')</a><br> |
| 75 | +(new css content: body { color: green; } and body h3 { color: orange; } ) |
| 76 | +<br> |
| 77 | + |
| 78 | +<h3>WebRequest test</h3> |
| 79 | + |
| 80 | +See the console for messages.<br> |
| 81 | + |
| 82 | +<a href="javascript:external.WebRequest('http://www.sitepoint.com/robots.txt')"> |
| 83 | + external.WebRequest('http://www.sitepoint.com/robots.txt')</a> |
| 84 | + |
| 85 | +<h3>Frame.CallFunction() test</h3> |
| 86 | + |
| 87 | +<script> |
| 88 | +function MyFunction(param1, param2, param3, param4) { |
| 89 | + alert("MyFunction() called\nparam1="+JSON.stringify(param1)+"\nparam2="+JSON.stringify(param2)+"\nparam3="+JSON.stringify(param3)+"\nparam4="+JSON.stringify(param4)) |
| 90 | +} |
| 91 | +</script> |
| 92 | +<a href="javascript:external.DoCallFunction()"> |
| 93 | + external.DoCallFunction()</a> |
| 94 | + |
| 95 | +<br><br><br><br><br><br><br><br><br><br><br> |
| 96 | +<br><br><br><br><br><br><br><br><br><br><br> |
| 97 | +<br><br><br><br><br><br><br><br><br><br><br> |
| 98 | + |
| 99 | +</body> |
| 100 | +</html> |
0 commit comments