From 0e5944e9c60a0133cebbe526470e319dc24bcf54 Mon Sep 17 00:00:00 2001 From: j433866 Date: Tue, 4 Jun 2019 11:59:44 +0100 Subject: [PATCH] Set URL input parameter when setting input. (e.g. when tab changed or removed) --- src/web/InputWaiter.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/web/InputWaiter.mjs b/src/web/InputWaiter.mjs index 710366d8..0669f059 100644 --- a/src/web/InputWaiter.mjs +++ b/src/web/InputWaiter.mjs @@ -352,6 +352,16 @@ class InputWaiter { const lines = inputData.input.length < (this.app.options.ioDisplayThreshold * 1024) ? inputData.input.count("\n") + 1 : null; this.setInputInfo(inputData.input.length, lines); + + // Set URL to current input + const inputStr = toBase64(inputData.input, "A-Za-z0-9+/"); + if (inputStr.length > 0 && inputStr.length <= 68267) { + this.setUrl({ + includeInput: true, + input: inputStr + }); + } + if (!silent) window.dispatchEvent(this.manager.statechange); } else { this.setFile(inputData);