electron/spec/fixtures/pages/css-transparent.html
Milan Burda 0b0707145b
refactor: replace .forEach() with for-of (#39691)
* refactor: replace `.forEach()` with `for-of`

* refactor docs/fiddles/features/web-hid/renderer.js
2023-08-31 23:36:43 +09:00

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>