From f68d9dad91ce225416dbb933eef30dae6647a19f Mon Sep 17 00:00:00 2001 From: vuk Date: Thu, 22 Aug 2024 15:54:57 +0200 Subject: [PATCH] extension should now communicate with the official website and hide an element from it --- manifest.json | 7 ++++--- scripts/milje.js | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 79afbb6..b568a13 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "browser-milje", "description": "adds a milje table cloth on top of your browser viewport", - "version": "0.0.1", + "version": "0.0.2", "action": { "default_popup": "popup.html", "default_icon": "assets/browser-milje.png" @@ -15,8 +15,9 @@ }, "content_scripts": [ { - "js": ["scripts/milje.js"], - "matches": ["", "file:///"] + + "matches": ["", "file:///"], + "js": ["scripts/milje.js"] } ] } diff --git a/scripts/milje.js b/scripts/milje.js index db3310e..fc0000d 100644 --- a/scripts/milje.js +++ b/scripts/milje.js @@ -20,4 +20,7 @@ div.style.backgroundSize = 'contain' div.style.backgroundRepeat = 'no-repeat' div.style.backgroundPosition = 'center' div.style.transform = 'translateY(-50%)' -document.body.appendChild(div) \ No newline at end of file +document.body.appendChild(div) + +const message = { extensionDetected: true }; +window.postMessage(message, "*"); \ No newline at end of file