electron: webview links not working

I’m working on switching my iframe to a webview in the atom web-browser package. It was an easy change. However my links in the page aren’t working. Nothing happens when I click on them.

For what it’s worth here is my code and the inspector display …

  @content: ->
    @div class:'browser-page', tabindex:-1, =>
      @tag 'webview'

fvsdv

Versions

  • Atom: 0.150.0
  • Atom-Shell: 0.19.2
  • OS: Microsoft Windows 8.1 Pro with Media Center
  • Misc
    • apm 0.111.0
    • npm 1.4.4
    • node 0.10.33
    • python 2.7.8
    • git 1.7.11.msysgit.1
    • visual studio 2013

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 33 (16 by maintainers)

Most upvoted comments

This isn’t a bug, you need to handle the new-window event to do this:

    webView.on 'new-window', (e) ->
      try
        theUrl = url.parse e.url
        throw new Error("Invalid protocol") unless theUrl.protocol in ['http:', 'https:', 'mailto:']

        require('shell').openExternal(e.url)
      catch error
        console.log "Ignoring #{e.url} due to #{error.message}"