webview-no-node-integration-on-window.html 606 B

123456789101112131415161718192021222324
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. document.addEventListener('DOMContentLoaded', function () {
  6. var windowUrl = decodeURIComponent(window.location.search.substring(3))
  7. var wv = new WebView()
  8. wv.setAttribute('nodeintegration', 'yes')
  9. wv.setAttribute('src', windowUrl)
  10. wv.setAttribute('style', 'display:inline-block; width:200px; height:200px')
  11. wv.addEventListener('console-message', function(e) {
  12. window.answer(e.message)
  13. })
  14. document.body.appendChild(wv)
  15. })
  16. </script>
  17. </head>
  18. <body>
  19. </body>
  20. </html>