mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
added support to generate qr from text selection
This commit is contained in:
parent
69d5f5c5e1
commit
20df2ac753
1 changed files with 2 additions and 1 deletions
|
@ -5927,7 +5927,8 @@ export async function text2qr(...args: string[]) {
|
||||||
|
|
||||||
text = args.join(" ").trim()
|
text = args.join(" ").trim()
|
||||||
if (!text || text.length == 0) {
|
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 urlEncodedText = encodeURIComponent(text)
|
||||||
const url = new URL(browser.runtime.getURL("static/qrcode.html"))
|
const url = new URL(browser.runtime.getURL("static/qrcode.html"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue