aboutsummaryrefslogtreecommitdiffstats
path: root/src/assets
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2023-03-05 19:35:14 +0300
committerManeraKai <manerakai@protonmail.com>2023-03-05 19:35:14 +0300
commitc5cd80da597a3e14a704c6d17d4e3e5e1b219dec (patch)
tree6bf9ac8ce92413c6828f69215a008d25f3067838 /src/assets
parentMerge https://github.com/libredirect/libredirect (diff)
downloadlibredirect-c5cd80da597a3e14a704c6d17d4e3e5e1b219dec.zip
Fixed bugs in the context menus
Diffstat (limited to 'src/assets')
-rw-r--r--src/assets/javascripts/services.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index c536851d..224dcd76 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -807,7 +807,17 @@ async function copyRaw(url, test) {
const newUrl = await reverse(url)
if (newUrl) {
if (!test) {
- navigator.clipboard.writeText(newUrl)
+ if (!window.chrome) {
+ navigator.clipboard.writeText(newUrl)
+ } else {
+ var copyFrom = document.createElement("textarea");
+ copyFrom.textContent = newUrl;
+ document.body.appendChild(copyFrom);
+ copyFrom.select()
+ document.execCommand('copy')
+ copyFrom.blur();
+ document.body.removeChild(copyFrom);
+ }
}
return newUrl
}