website should now communicate with the extension and hide an element based on it's presence

This commit is contained in:
vuk 2024-08-22 15:56:10 +02:00
parent 79013efd2e
commit 833f0c47f6
2 changed files with 19 additions and 1 deletions

View File

@ -3,9 +3,27 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <style>
#test-milje {
position: fixed;
top: 0;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
}
</style>
<script async>
window.addEventListener("message", (event) => {
if (event.data.extensionDetected) {
const elementToHide = document.getElementById("element-id");
if (elementToHide) elementToHide.style.display = "none";
}
});
</script>
<title>миљеген</title>
</head> </head>
<body> <body>
<img id="test-milje" src="test-milje.png" alt="не би требало да видиш ову слику...">
<h1>миљеген</h1> <h1>миљеген</h1>
<h2>званична страница</h2> <h2>званична страница</h2>
<p>бојлерплејт хихи</p> <p>бојлерплејт хихи</p>

BIN
test-milje.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 KiB