mirror of
https://github.com/TristanEDU/LiveOverlayExtension.git
synced 2026-01-18 10:30:34 +00:00
initial commit, I pasted in the GPT sugested code for the project. I read it over and as far as I understand JavaScript it should work properly
This commit is contained in:
parent
99f07458ee
commit
deb066111f
30
content.js
30
content.js
@ -0,0 +1,30 @@
|
||||
if (!document.getElementById("overlay-iframe")) {
|
||||
const iframe = document.createElement("iframe");
|
||||
iframe.src = "https://hiousa.com"; // Change to your overlay site
|
||||
iframe.id = "overlay-iframe";
|
||||
iframe.style.position = "fixed";
|
||||
iframe.style.top = "0";
|
||||
iframe.style.left = "0";
|
||||
iframe.style.width = "100vw";
|
||||
iframe.style.height = "100vh";
|
||||
iframe.style.zIndex = "9999";
|
||||
iframe.style.pointerEvents = "none";
|
||||
iframe.style.opacity = "0.5";
|
||||
|
||||
const slider = document.createElement("input");
|
||||
slider.type = "range";
|
||||
slider.min = 0;
|
||||
slider.max = 100;
|
||||
slider.value = 50;
|
||||
slider.style.position = "fixed";
|
||||
slider.style.top = "10px";
|
||||
slider.style.right = "10px";
|
||||
slider.style.zIndex = "10000";
|
||||
|
||||
slider.oninput = (e) => {
|
||||
iframe.style.opacity = e.target.value / 100;
|
||||
};
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
document.body.appendChild(slider);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Live Site Overlay Tool",
|
||||
"version": "1.0",
|
||||
"description": "Overlay one live site over another for pixel-perfect comparison.",
|
||||
"permissions": ["scripting", "activeTab"],
|
||||
"host_permissions": ["<all_urls>"],
|
||||
"action": {
|
||||
"default_title": "Overlay a site"
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["content.js"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user