-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs-practical-v1.27.html
More file actions
40 lines (36 loc) · 1.35 KB
/
Copy pathjs-practical-v1.27.html
File metadata and controls
40 lines (36 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!doctype html>
<html dir="rtl" lang="ar">
<head>
<title>تطبيق عملي</title>
</head>
<body>
<button id="حفظ">حفظ</button>
<script>
const سياسة = trustedTypes.createPolicy("واجهة", {
createHTML(value) { return value; }
});
async function احفظ() {
const ملفات = await window.showOpenFilePicker();
const File = await ملفات[0].getFile();
const وجهة_ملف = await window.showSaveFilePicker({ اسم_مقترح: File.اسم });
const كاتب = await وجهة_ملف.createWritable();
await كاتب.write(File);
await كاتب.close();
}
async function case() {
const مساحة = await navigator.storage.estimate();
if (navigator.canShare?.({ text: "جاهز" })) {
await navigator.share({ title: "تقرير", text: "جاهز" });
}
navigator.sendBeacon("/قياس", JSON.stringify(مساحة));
navigator.vibrate?.(20);
}
window.addEventListener("beforeinstallprompt", function (Event) {
Event.preventDefault();
});
const ضغط_تيار = new CompressionStream("gzip");
const رابط_صالح = URL.canParse("/app", window.location.اصل);
زر.addEventListener("click", function () { احفظ(); case(); });
</script>
</body>
</html>