8000 Custom standard schemes should be registered as secure schemes · Issue #7670 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Custom standard schemes should be registered as secure schemes #7670
Closed
@pfrazee

Description

@pfrazee
  • Electron version: 1.4.3
  • Operating system: MacOS 10.12

I created an app demonstrating the issue: https://github.com/pfrazee/electron-bug-securewebviewcrash. Let me know if you have trouble reproducing.

This occurs around a webview:

<webview id="theWebview" src="custom://webview.html" preload="./webview-preload.js"></webview>

The webview opens a custom protocol, which is registered as follows:

protocol.registerStandardSchemes(['custom'])
app.on('ready', () => {
  protocol.registerHttpProtocol('custom', (req, cb) => {
    cb({ method: 'GET', url: 'http://localhost:12345' })
  }, () => console.log('Registered "custom" protocol'))
})
http.createServer((req, res) => res.end('Hello, world. This is the webview')).listen(12345)

The webview has a preload script which registers it as a secure protocol:

var { webFrame } = require('electron')
webFrame.registerURLSchemeAsPrivileged('custom')

For some reason, this combination causes devtools to crash the webview when the Application tab is opened. I used the more fine-grained controls in #7665 to isolate this specifically to the "secure" flag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0