0b0707145b
* refactor: replace `.forEach()` with `for-of` * refactor docs/fiddles/features/web-hid/renderer.js
31 lines
770 B
HTML
31 lines
770 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>test-color-window</title>
|
|
<style>
|
|
body {
|
|
background: red;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body id="body">
|
|
<script>
|
|
const { ipcRenderer } = require('electron');
|
|
|
|
const observer = new MutationObserver((mutationList, observer) => {
|
|
for (const { type, attributeName } of mutationList) {
|
|
if (type === 'attributes' && attributeName === 'style') {
|
|
ipcRenderer.send('set-transparent');
|
|
}
|
|
}
|
|
});
|
|
|
|
observer.observe(document.body, { attributes: true });
|
|
|
|
document.addEventListener('DOMContentLoaded', event => {
|
|
document.body.style.background = 'transparent';
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|