You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Figure out how make copying the API key to clipboard easier than having to highlight the key and then press Ctrl+C or use other methods for copying (context menu etc.) One option would be adding a "Copy" button next to API key on the Profile page.
The text was updated successfully, but these errors were encountered:
I did a little research on topic "copying value to clipboard" and it turns out that direct copying (or forcing copying) data to clipboard using JS function may not be supported by all browsers and can cause security vulnerabilities.
Anyhow, the solution I came up with is listed on stackoverflow:
varcopyTextareaBtn=document.querySelector('.js-textareacopybtn');copyTextareaBtn.addEventListener('click',function(event){varcopyTextarea=document.querySelector('.js-copytextarea');copyTextarea.select();try{varsuccessful=document.execCommand('copy');varmsg=successful ? 'successful' : 'unsuccessful';console.log('Copying text command was '+msg);}catch(err){console.log('Oops, unable to copy');}});
So, if for some reason after copying it is not able to get the value, we can ask user to copy ket manually using alert() for instance.
@brylie Have you been suggesting some JS library that would be helpful?
Figure out how make copying the API key to clipboard easier than having to highlight the key and then press Ctrl+C or use other methods for copying (context menu etc.) One option would be adding a "Copy" button next to API key on the Profile page.
The text was updated successfully, but these errors were encountered: