mirror of
https://github.com/Polaris-Entertainment/bytefy.git
synced 2026-04-11 18:29:38 +00:00
Add chrome extension
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
||||
let url = tabs[0].url;
|
||||
generateQRCode(url);
|
||||
});
|
||||
});
|
||||
|
||||
function generateQRCode(url) {
|
||||
let qrCodeElement = document.getElementById('qrcode');
|
||||
qrCodeElement.innerHTML = "";
|
||||
|
||||
if (typeof QRCode !== 'undefined') {
|
||||
new QRCode(qrCodeElement, {
|
||||
text: url,
|
||||
width: 256,
|
||||
height: 256
|
||||
});
|
||||
} else {
|
||||
console.error("QRCode library is not loaded.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user