Last active
October 26, 2019 05:21
-
-
Save HaNdTriX/e80bbbc93d80be9889d8aceb4b8c20a2 to your computer and use it in GitHub Desktop.
Electron Fiddle Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Empty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment