Theme Files Update
This commit is contained in:
parent
0154182af0
commit
bbc0089b64
4 changed files with 20 additions and 7 deletions
7
assets/js/link-share.js
Normal file
7
assets/js/link-share.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
async function linkShare(t, u, s){
|
||||
let data = {title: t,text: s,url: u};
|
||||
if(navigator.canShare(data)){
|
||||
try {await navigator.share(data);} catch (er) {console.error(er);}
|
||||
}else if (navigator?.clipboard?.writeText){
|
||||
try {await navigator.clipboard.writeText(u);} catch (err) {console.error(err);}
|
||||
}else{console.log("Neither WebShare API nor CLipboard API is supported")}}
|
Loading…
Add table
Add a link
Reference in a new issue