added support to generate qr from text selection

This commit is contained in:
satyamk 2023-06-12 01:18:42 +05:30
parent 69d5f5c5e1
commit 20df2ac753

View file

@ -5927,7 +5927,8 @@ export async function text2qr(...args: string[]) {
text = args.join(" ").trim()
if (!text || text.length == 0) {
text = window.location.href
text = document.getSelection().toString().trim()
if (!text || text.length == 0) text = window.location.href
}
const urlEncodedText = encodeURIComponent(text)
const url = new URL(browser.runtime.getURL("static/qrcode.html"))