-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: navigator.share.qrCode
#204
Comments
It wouldn't be ideal to have a particular type of share specifically for QR codes, but are QR codes identifiable as a media type? I've never looked at how they are created/structured or if they are even standardized, but maybe just sharing as I think it goes roughly blob with media type -> QR code representation. |
Something else that's quite common is to share a PDF version of the page or (probably less common) a web archive version of the page (example link). So QR code would not need to be the only option. Maybe
They are to become an ISO standard, but I don't think they will have a media type.
Unsure about the plural here. |
True, but the idea here would be to let the developer do something with the created QR code, PDF, etc., and not just expose the system UI.
For me it's CHF 58 for whatever reason (I'm based in € Europe). But /me shakes fist, too…
Ah, gotcha. |
It could be a good idea to reconsider #180 if we want this. |
I still think this should just be a "file"... or at least, we should see if it can't be a file. |
The original idea from this Issue was to tap into browser-facilitated share methods, like Chrome's Create QR code for this Page, so people don't need to pull in a QR code generation library but could use the browser's. |
Ah, lol! sorry!!! I had misunderstood as I've not seen this before. Just found it in Chrome. That's super cool!!!!! :D So, maybe something like navigator.share({ url: "other thing", as: "qr" });
navigator.share({ text: "some text", as: "qr" }); |
My bad, I could have added a help link to the initial post instead of just describing the feature and assuming people are aware.
navigator.share({ url: location.href, as: "qr" });
Yeah, it's a hidden power-feature that the text can be changed. So +1 to exposing it! Additional options could be |
I like where this is going :) it has the nice quality that it has fallback model. |
How could this be feature detected? |
Maybe by extending |
|
Should this be feature detectable? It's aspirational. |
Well, it would be confusing to request a qr code and then get a plain share dialog? |
could be... but I think that's a UX thing. Like the UI could allow the user to just switch it to normal text/url/whatever. |
(and the other way around too... like, I could share a URL and have something in the UI show it as a QR code) |
That would be cool and would probably not require adding any API. |
Closing for now, as it seems possible to simply share the URL and have the share target or user agent present it as a QR code. |
Chromium has added an option to get a QR code for the current URL via the URL bar. It would probably be useful to expose this feature as a browser API on all form factors to let developers add QR code generation as a feature to their apps. A possible location could be…
This would return a QR code image blob that developers could then show according to their own needs. I believe it could be a synchronous function, since no permission would be required.
(Original idea via this tweet.)
The text was updated successfully, but these errors were encountered: