Skip to content

Instantly share code, notes, and snippets.

@HaNdTriX

HaNdTriX/index.html

Last active Oct 26, 2019
Embed
What would you like to do?
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<button id='audioMutedTrue'>audioMuted true</button>
<button id='setAudioMutedTrue'>setAudioMuted true</button>
<button id='audioMutedFalse'>audioMuted false</button>
<button id='setAudioMutedFalse'>setAudioMuted false</button>
<webview src='https://files-b8xkyxegj.now.sh/sound.html' height="600" style="display:inline-flex; width:640px; height:600px"/>
<script>
const webview = document.querySelector('webview')
document.getElementById('audioMutedTrue').onclick = () => {
webview.audioMuted = true
}
document.getElementById('setAudioMutedTrue').onclick = () => {
webview.setAudioMuted(true)
}
document.getElementById('audioMutedFalse').onclick = () => {
webview.audioMuted = false
}
document.getElementById('setAudioMutedFalse').onclick = () => {
webview.setAudioMuted(false)
}
</script>
</body>
</html>
const { app, BrowserWindow } = require('electron')
app.on('ready', () => {
const window = new BrowserWindow({
webPreferences: {
webviewTag: true
}
})
// and load the index.html of the app.
window.loadFile('index.html')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.