[Question]
  [
*(based on [this](https://codegolf.meta.stackexchange.com/a/12146/42963) post and the [ensuing discussion](http://chat.stackexchange.com/transcript/message/36815472#36815472) on chat -- also, much thanks to Dennis for TIO!)*
## The Challenge
Choose a language that's currently available on the [TryItOnline site](https://tio.run/), for example [PowerShell](https://tio.run/#powershell). Write code in that language on that page, that doesn't take any input, such that when the *Run* button is clicked, the output on that page is the *exact same* as what is in the "Plain URL" field when the *Save/Store* button is clicked instead.
For a fictitious example, suppose that `aaa` was the code for a solution to this in PowerShell. Then, the result of clicking *Run* with `aaa` as the code on `https://tio.run/#powershell` should output `https://tio.run/##K8gvTy0qzkjNyfn/PzEx8f9/AA`, which is also the "Plain URL" field when the *Save/Store* button is clicked.
## Scoring
The *resulting URL* is your submission to this challenge. The winner is the shortest URL measured in bytes. For the example above, the URL `https://tio.run/##K8gvTy0qzkjNyfn/PzEx8f9/AA` is the submission to the challenge, at **44 bytes**. The shortest URL that fulfills the rest of this challenge wins the challenge and earns brownie points (points not redeemable). Given that there is a distinct minimum possible length, if two submissions tie in length, the earlier submission wins.
## URL Generation
[This](https://github.com/TryItOnline/tryitonline/blob/master/usr/share/tio.run/frontend.js#L391) is the start of the URL generation algorithm in the repository. You can see how the main code area is taken, any extra elements are appended, the string is deflated and Base64 converted, and then `##` prepended, etc. I won't go into full detail here; part of the challenge is to parse and understand how the URLs are generated in order to exploit any potential quirks in said algorithm.
## Rules / Clarifications
* The actual code should take no input and produce only the quine-URL as output.  
-- This means the only text fields that should be populated when clicking into the URL are the `Code`, `Header`, `Footer` or corresponding "Compiler Flag" fields; the `Input` and `Arguments` fields are forbidden and must remain empty/unused. Clicking the *Run* button should only change the `Output` field. For this challenge, the `Debug` field is ignored in all situations.
* Usual quine rules apply to the code to the extent possible (for example, the code cannot read its own source code via `.code.tio`).
* Please include a description of how the code works in your submission.
* Submitting a "cheaty" quine by submitting a Git pull request to the TIO repository to create a "trick" URL or shortcut or the like is not allowed.
* Similarly, submitting a pull request to update a particular language to produce a "trick" URL is not allowed.
* Please be nice to Dennis' servers and don't abuse them or attempt exploits for the sake of this challenge.
  
[Answer]
# [Python 2](https://docs.python.org/2/), URL length = 170 bytes
```
https://tio.run/##K6gsycjPM/r/v9hWqQDCjqlISwPhYlvVIuvM3IL8ohKFpMTiVDMT64KizLwS9YySkoJiK339ksx8vaLSPH1lZXVtiAK9JDOT1Lzk/JRUDY1iVdViTT0YT70qJzNJXVMz2shK1yRWE2aHEkUW4Db//38A
```
```
s="python2\xff\xffs=%r;import base64;print'https://tio.run/##'+base64.b64encode((s%%s).encode(('zlib'))[2:-4])\xff\xff";import base64;print'https://tio.run/##'+base64.b64encode((s%s).encode(('zlib'))[2:-4])
```
[Try it online!](https://tio.run/##K6gsycjPM/r/v9hWqQDCjqlISwPhYlvVIuvM3IL8ohKFpMTiVDMT64KizLwS9YySkoJiK339ksx8vaLSPH1lZXVtiAK9JDOT1Lzk/JRUDY1iVdViTT0YT70qJzNJXVMz2shK1yRWE2aHEkUW4Db//38A "Python 2 – Try It Online")
This relies on three coincidences:
1. The default zlib level 6 happens to give the same results as zlib level 9 for this string, modulo the header that I strip.
2. The compressed length is divisible by 3, so base64 does not generate any `=` padding characters.
3. The base64 output does not contain any `+` characters.
[Answer]
# [Bash](https://www.gnu.org/software/bash/), ~~174~~ ~~166~~ ~~165~~ 157 bytes
```
https://tio.run/##S0oszvj/v6QosUBBV1dBvaAoM68kTSGjpKSg2EpfvyQzP0avqDRPX1lZRQMqp6RaHFORlgbCSgpJQO0KSgkg/QlKNelVmQU1JYmZOQq6ydqGhjVA2VQzEwXdckNjS011BdcIz5D//wE
```
This encodes the following Bash program.
```
trap -- 'printf https://tio\.run/##$(printf "%s\xff\xff" bash "`trap`"|gzip|tail -c+11|base64 -w139)' EXIT
```
[Try it online!](https://tio.run/##S0oszvj/v6QosUBBV1dBvaAoM68kTSGjpKSg2EpfvyQzP0avqDRPX1lZRQMqp6RaHFORlgbCSgpJQO0KSgkg/QlKNelVmQU1JYmZOQq6ydqGhjVA2VQzEwXdckNjS011BdcIz5D//wE "Bash – Try It Online")
*Thanks to @jimmy23013 for golfing 8 bytes off my original approach, for an approach that saved another byte, and for golfing another 8 bytes off that approach!*
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), URL length = 134 bytes
```
https://tio.run/##K6gsyfj/X68syy/ZS6lYmyujpKSg2EpfvyQzX6@oNE9fWZnLwae4OLrI3dA9NITLQZ9LM8vZxqSkRC@qOJqrAKiby9vZyNTUmwtiBpefl7e3ppnJ//8A
```
Code:
```
.vjNcJ"s+
https://tio.run/##
@Lss[rG1GUT
@/
)jC<4tt.Zs[
pyth
KC255K
.vjNcJ
NJKK)64
```
[Try it online!](https://tio.run/##K6gsyfj/X68syy/ZS6lYmyujpKSg2EpfvyQzX6@oNE9fWZnLwae4OLrI3dA9NITLQZ9LM8vZxqSkRC@qOJqrAKiby9vZyNTUmwtiBpefl7e3ppnJ//8A "Pyth – Try It Online")
Uses Pyth’s zlib builtin (`.Z`), and an inline implementation of base64.
### How it works
The outer stage:
```
.vjNcJ"…
      "…    take this 75-byte string
     J      assign it to J
    c       split on whitespace
  jN        join on N = '"'
.v          evaluate as Pyth code
```
The inner stage, obtained by replacing whitespace in the string `J` with double quotes:
```
s+"https://tio.run/##"@Lss[rG1GUT"@/")jC<4tt.Zs["pyth"KC255K".vjNcJ"NJKK)64
                                               [                             begin a list:
                                                "pyth"                         string,
                                                       C255                    character 255
                                                      K                        assign that to K,
                                                           K                   K again,
                                                            ".vjNcJ"           string,
                                                                    N          '"',
                                                                     J         J (the 75-byte string),
                                                                      K        K again,
                                                                       K       K again
                                                                        )    end list
                                              s  concatenate
                                            .Z   compress with zlib
                                           t     remove first character
                                          t      remove first character
                                        <4       remove last 4 characters
                                       C         convert from base 256
                                      j                                  64
                                                 convert to base 64 digits
                      @L                         map d ↦ the following indexed at d:
                          [                        begin a list:
                            G                        alphabet ("abcdefghijklmnopqrstuvwxyz")
                           r 1                       uppercase,
                              G                      alphabet again,
                               UT                    unary range of length T = 10: [0, …, 9],
                                 "@/"                string,
                                     )             end list
                         s                         concatenate
                        s                          concatenate (we now have the base64 alphabet)
 +"https://tio.run/##"                           prepend string
s                                                concatenate
```
(It’s too bad the “Input” field is disallowed, or I’d have a [118 byte solution](https://tio.run/##K6gsyfj/v1hbKaOkpKDYSl@/JDNfr6g0T19ZWcnBp7g4usjd0D00RMlBX0kzy9nGpKREL0pbqQCoS0nLSFvLyNnI1LTKzIQKRgAA "Pyth – Try It Online").)
[Answer]
# PowerShell, 274 bytes
```
https://tio.run/##TY/rCsIwDIVfZaiYFV2HooIbgu8xBrYzboXSljYq3p59VkHZjxAOJydf4uwVfehQ676fphO5e1TK8pPSWBfF1StCobW8EYYUJMyrphO@qmtw/xzMluv1t37maJoePpsm8sVGP5eV7V25JDslsozmgOJRHAcQ3t6BldARuVDkOcVBfzb5eAwRYM0FPcUQWSkCblaBvDJtPLxaLDmPnTf2bCjbsppxj06LBlPYwRxgoGdR74E9vw9mnQ2UZObF@v4N
```
It's all thanks to the following snippet:
```
&($b={[io.file]::writeallbytes('b',[char[]]'powershell'+255+255+[char[]]"&(`$b={$b})"+255+255);gzip -f b;$b=[io.file]::readallbytes('b.gz');'https://tio.run/##'+[convert]::tobase64string($b[12..($b.count-9)]).replace('=','').replace('+','@')|write-host -n})
```
[Try it online!](https://tio.run/##TY/rCsIwDIVfZaiYFV2HooIbgu8xBrYzboXSljYq3p59VkHZjxAOJydf4uwVfehQ676fphO5e1TK8pPSWBfF1StCobW8EYYUJMyrphO@qmtw/xzMluv1t37maJoePpsm8sVGP5eV7V25JDslsozmgOJRHAcQ3t6BldARuVDkOcVBfzb5eAwRYM0FPcUQWSkCblaBvDJtPLxaLDmPnTf2bCjbsppxj06LBlPYwRxgoGdR74E9vw9mnQ2UZObF@v4N)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 214 bytes
```
v=()=>console.log('https://tio.run/##'+require(`zlib`).deflateRawSync(Buffer.from(`javascript-node\xff\xffv=`+v+`;v()\xff\xff`,`ascii`)).toString("base64"));v()
```
[Try it online!](https://tio.run/##VY07EoIwFADvAgXJoKFxLHSw8AjSWrwALxgmJPgS4ufyUQoLi212dmZHGaXvSM9ha12PKcWa8frUOeudQWHcwIpbCLM/VFXQTtBiqzwvSsL7ogkZvI1ugYselZEBL/LRvGzHzotSSEKRmxiM/4/rU6mVWEMZSzhGxn8KNvAttQbORXBNIG0HlrXS436Xcb6mKX0A "JavaScript (Node.js) – Try It Online")
]