more trials. blocked by DOM

This commit is contained in:
2023-09-02 15:53:17 +05:30
parent 24a27db1bc
commit 67998b1a47

View File

@@ -1,9 +1,20 @@
<script> <script lang="ts">
let tableEle:HTMLTableElement;
function share(){ function share(){
console.log(tableEle)
const tableBlob = new Blob([tableEle], {type:'text/plain'})
const tableFile = new File([tableBlob], 'messagebody.html')
console.log(tableFile)
const data = { const data = {
text: 'hello world', files: [
tableFile,
]
} }
if(navigator.canShare(data))
navigator.share(data) navigator.share(data)
.catch(m => {
console.log(m)
})
} }
</script> </script>
@@ -11,7 +22,7 @@
This will be populated&hellip; sometime This will be populated&hellip; sometime
</p> </p>
<table class="grid-table border-collapse"> <table bind:this={tableEle} class="grid-table border-collapse">
<tr> <tr>
<th scope="row">Semester</th> <th scope="row">Semester</th>
<td>N</td> <td>N</td>