electron/spec/fixtures/pages/css-transparent.html

32 lines
770 B
HTML
Raw Normal View History

<!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>