Following T242467: Automatically generate and display QR Code, we'll have a link in the toolbox to download an SVG of a QR code. However, the link does nothing if JavaScript is disabled. Additionally, without knowledge of the API, users have no means to generate QR codes for pages that don't show the toolbox.
We could bundle QR code functionality into the existing Special:UrlShortener, but for URLs that are already somewhat short, we don't want to shorten them further for QR codes because when users scan the QR code, it should show a URL they're familiar with and not https://w.wiki/ which some people may not necessarily trust. For this reason, it makes the most sense to have a separate Special page.
Designs
Subject to review by @JSengupta-WMF
Borrowing from older versions of the Figma for T242467, it would look and function similar to Special:UrlShortener except show the QR Code on the right (or below if viewport is too narrow), along with a download button.
Something like the following, except without the logo (which we may add in a future iteration), and the title should be "QR code":
Acceptance criteria
- Following the same rules as the API, URLs for QR codes are only shortened if they exceed 200 bytes in length
- If the URL is shortened, the "Shortened URL" field with a copy button should be shown just like it is at Special:UrlShortener
- If the URL is not shortened, we do not show the URL with a copy button as this would be redundant.
- Embed the SVG directly on the page in an <img> tag, using a data URI for both the src= of the image as well as the href= of the download button.
- Debatable: the idea here was to simply avoid backend storage which isn't needed for SVGs in particular, but might be if we wanted PNGs
- Providing a ?url=[encoded URL] parameter to Special:QrCode should pre-supply the input field.
Possible improvements:
- A path parameter can be any localized link and Special:QrCode will transform it into a URL. I.e. browsing to Special:QrCode/User:MusikAnimal on enwiki would pre-supply the URL field with https://en.wikipedia.org/wiki/User:MusikAnimal