Trigger the extension with a floating button
// Create a rounded floating button in the bottom right corner and inject into the DOM
let button = document.createElement("button");
button.innerHTML = "C"; // Button label
button.style.position = "fixed";
button.style.bottom = "20px";
button.style.right = "20px";
button.style.zIndex = "9999";
button.style.borderRadius = "50%"; // Makes the button round
button.style.width = "50px"; // Circle width
button.style.height = "50px"; // Circle height
button.style.lineHeight = "50px"; // Vertically align text
button.style.textAlign = "center"; // Horizontally align text
button.style.padding = "0"; // Adjust padding to 0 for alignment
button.style.backgroundColor = "yellow"; // Yellow background
button.style.color = "black"; // Black font color
button.style.border = "none";
button.style.cursor = "pointer";
button.style.boxShadow = "0 4px 8px rgba(0,0,0,0.3)"; // More prominent shadow
document.body.appendChild(button);
button.onclick = function () {
// Send a message to background.js to open the iframe sidebar
chrome.runtime.sendMessage({ type: "openIframeSidebar", url: url, width: width }, function (response) {
console.log(response.status);
});
};


Last updated