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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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) => {
mutationList.forEach(({ type, attributeName }) => {
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>