about summary refs log tree commit diff stats
path: root/src/assets/javascripts/services.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/assets/javascripts/services.js')
-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
 	}