Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pfrazee/electron-bug-securewebviewcrash
This app demos a bug in Electron's devtools when a custom protocol is registered as secure.
https://github.com/pfrazee/electron-bug-securewebviewcrash
Last synced: 14 days ago
JSON representation
This app demos a bug in Electron's devtools when a custom protocol is registered as secure.
- Host: GitHub
- URL: https://github.com/pfrazee/electron-bug-securewebviewcrash
- Owner: pfrazee
- License: cc0-1.0
- Created: 2016-10-19T17:55:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-19T17:59:39.000Z (about 8 years ago)
- Last Synced: 2024-10-30T15:54:42.498Z (2 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# electron-bug-securewebviewcrash
## To Reproduce
Install and start the app:
```bash
# Clone this repository
git clone https://github.com/pfrazee/electron-bug-securewebviewcrash.git
# Go into the repository
cd electron-bug-securewebviewcrash
# Install dependencies and run the app
npm install && npm start
```Click the "Open Devtools" button, then click the "Application" tab of devtools.
The webview will crash.## The Bug
The webview opens a custom protocol, which is registered as follows:
```js
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:
```js
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 https://github.com/electron/electron/pull/7665 to isolate this specifically to the "secure" flag.