Browse Source

Set URL input parameter when setting input.
(e.g. when tab changed or removed)

j433866 6 năm trước cách đây
mục cha
commit
0e5944e9c6
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      src/web/InputWaiter.mjs

+ 10 - 0
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);