diff --git a/main.js b/main.js
index 0553860..16a61f1 100644
--- a/main.js
+++ b/main.js
@@ -73,6 +73,7 @@ const defaultSettings = {
index: true,
scan: true,
unityHack: true,
+ sharedArrayBuffers: false,
extensions: ['html'],
recent: [],
};
diff --git a/src/index.html b/src/index.html
index b4e011a..7c7674c 100644
--- a/src/index.html
+++ b/src/index.html
@@ -43,6 +43,10 @@
A simple web server for local web development
+
+
+
+
diff --git a/src/index.js b/src/index.js
index f5a9f25..435a3c3 100644
--- a/src/index.js
+++ b/src/index.js
@@ -203,6 +203,7 @@ ipcRenderer.on('stopped', () => {
startElem.textContent = "Start";
launchElem.disabled = true;
log("server stopped");
+ clearQRCodes();
});
ipcRenderer.send('getSettings');
@@ -283,12 +284,14 @@ function updateSettings() {
function addQRCode(s) {
const qr = QrCode.encodeText(s, Ecc.MEDIUM);
const scale = 4;
- ctx.canvas.width = qr.size * scale;
- ctx.canvas.height = qr.size * scale;
+ const padding = 3;
+ const size = qr.size + padding * 2;
+ ctx.canvas.width = size * scale;
+ ctx.canvas.height = size * scale;
ctx.scale(scale, scale);
- for (let y = 0; y < qr.size; y++) {
- for (let x = 0; x < qr.size; x++) {
- ctx.fillStyle = qr.getModule(x, y) ? 'black' : 'white';
+ for (let y = 0; y < size; y++) {
+ for (let x = 0; x < size; x++) {
+ ctx.fillStyle = qr.getModule(x - padding, y - padding) ? 'black' : 'white';
ctx.fillRect(x, y, 1, 1);
}
}