mirror of
https://github.com/Polaris-Entertainment/bytefy.git
synced 2026-04-17 04:45:52 +00:00
Add chrome extension
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const content = urlParams.get('content');
|
||||
const type = urlParams.get('type');
|
||||
generateBarcode(content, type);
|
||||
});
|
||||
|
||||
function generateBarcode(content, type) {
|
||||
if (type === "ean13") {
|
||||
JsBarcode("#barcode", content, { format: "EAN13" });
|
||||
document.getElementById("type").innerText = "EAN-13";
|
||||
} else if (type === "ean8") {
|
||||
JsBarcode("#barcode", content, { format: "EAN8" });
|
||||
document.getElementById("type").innerText = "EAN-8";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user