mirror of
https://github.com/Polaris-Entertainment/bytefy.git
synced 2026-04-09 09:29:39 +00:00
22 lines
520 B
JavaScript
22 lines
520 B
JavaScript
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.");
|
|
}
|
|
}
|