Require user-supplied URLs to be http protocol

This commit is contained in:
Max Goodhart
2020-06-20 23:02:47 -07:00
parent 23e195ba03
commit 1217eeb92f
3 changed files with 11 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
import isEqual from 'lodash/isEqual'
import { Machine, assign } from 'xstate'
import { ensureValidURL } from '../util'
const viewStateMachine = Machine(
{
id: 'view',
@@ -116,6 +118,7 @@ const viewStateMachine = Machine(
services: {
loadPage: async (context, event) => {
const { content, view } = context
ensureValidURL(content.url)
const wc = view.webContents
wc.audioMuted = true
await wc.loadURL(content.url)