mirror of
https://github.com/Viren070/stremio-addons-list.git
synced 2025-12-01 23:19:02 +01:00
feat: update copyLink function to directly copy link
This commit is contained in:
@@ -102,10 +102,15 @@
|
||||
});
|
||||
})
|
||||
function copyLink(event, link) {
|
||||
let copyLinkMsg = 'Copy Share Link to Clipboard: Ctrl+C, Enter\nPaste in the Search of the Stremio App'
|
||||
if (window.isMobile)
|
||||
copyLinkMsg = 'Copy Share Link to Clipboard: Long Press Text, Select Copy\nPaste in the Search of the Stremio App'
|
||||
window.prompt(copyLinkMsg, link)
|
||||
let copyLinkMsg = 'The link was copied to your clipboard\nPress Ctrl + V in the search bar of the Stremio app and press Enter'
|
||||
if (window.isMobile)
|
||||
copyLinkMsg = 'The link was copied to your clipboard\nPress and hold in the search bar of the Stremio app and select Paste'
|
||||
navigator.clipboard.writeText(link).then(function() {
|
||||
console.log('Link copied to clipboard');
|
||||
}, function(err) {
|
||||
console.error('Could not copy text: ', err);
|
||||
});
|
||||
window.alert(copyLinkMsg)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -117,14 +117,19 @@
|
||||
loadIsotope()
|
||||
})
|
||||
function copyLink(event, link) {
|
||||
console.log('link', link)
|
||||
console.log('event', event)
|
||||
let copyLinkMsg = 'Copy Share Link to Clipboard: Ctrl+C, Enter\nPaste in the Search of the Stremio App'
|
||||
if (window.isMobile)
|
||||
copyLinkMsg = 'Copy Share Link to Clipboard: Long Press Text, Select Copy\nPaste in the Search of the Stremio App'
|
||||
window.prompt(copyLinkMsg, link)
|
||||
event.preventDefault()
|
||||
return false
|
||||
console.log('link', link)
|
||||
console.log('event', event)
|
||||
let copyLinkMsg = 'The link was copied to your clipboard\nPress Ctrl + V in the search bar of the Stremio app and press Enter'
|
||||
if (window.isMobile)
|
||||
copyLinkMsg = 'The link was copied to your clipboard\nPress and hold in the search bar of the Stremio app and select Paste'
|
||||
navigator.clipboard.writeText(link).then(function() {
|
||||
console.log('Link copied to clipboard');
|
||||
}, function(err) {
|
||||
console.error('Could not copy text: ', err);
|
||||
});
|
||||
window.alert(copyLinkMsg)
|
||||
event.preventDefault()
|
||||
return false
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user