diff --git a/assets/css/index.css b/assets/css/index.css index e0df80d..e033f25 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -2366,25 +2366,9 @@ body.toHook .done .channels .selectOptions .hook { /* Send button and components **/ - - - - - - - - - - - - - - - - - - - +.invisible { + display: none!important; +} ::-webkit-scrollbar { width: 7px; diff --git a/assets/js/script.js b/assets/js/script.js index 837f80b..6a9bd0e 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -64,7 +64,6 @@ var params = currentURL().searchParams, if (autoParams) isReversed ? urlOptions({ set: ['reverse', ''] }) : urlOptions({ remove: 'reverse' }); }, urlOptions = ({ remove, set }) => { - console.log(remove, set); const url = currentURL(); if (remove) url.searchParams.delete(remove); if (set) url.searchParams.set(set[0], set[1]); @@ -970,8 +969,26 @@ addEventListener('DOMContentLoaded', () => { }) document.querySelector('.top-btn.menu')?.addEventListener('click', e => { - if (e.target.closest('.item.dataLink')) - return prompt('Here\'s the current URL with base64 embed data:', jsonToBase64(json, true)); + if (e.target.closest('.item.dataLink')) { + const data = jsonToBase64(json, true); + // With long text inside a 'prompt' on Chromium based browsers, some text will but cut and replaced with '...'. + // So, for the Chromium users, we copy to clipboard instead of showing a prompt. + if (!window.chrome) + return prompt('Here\'s the current URL with base64 embed data:', data); + if (location.protocol === 'http:') + // Clipboard API only works on HTTPS protocol. + navigator.clipboard.writeText(data); + else { + const input = document.createElement('input'); + input.value = data; + document.body.appendChild(input); + input.select(); + document.execCommand('copy'); + document.body.removeChild(input); + } + + alert('Copied to clipboard.'); + } const input = e.target.closest('.item')?.querySelector('input'); if (input) input.checked = !input.checked; diff --git a/index.html b/index.html index 90ad0b6..c506e22 100644 --- a/index.html +++ b/index.html @@ -119,7 +119,7 @@ -
Get data link
+
Get URL with data link
@@ -334,5 +334,6 @@
+ \ No newline at end of file