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
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
@@ -30,7 +30,21 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
30
30
31
31
letpScanner=null;
32
32
letlatestResult=null;
33
-
window.onload=asyncfunction(){
33
+
34
+
functionstartNotificationLoop(){
35
+
if(latestResult!=null){
36
+
consttitle="New Barcode Found!";
37
+
constnotifBody=`Barcode Text: ${latestResult}.`;
38
+
constoptions={
39
+
body: notifBody,
40
+
};
41
+
newNotification(title,options);
42
+
latestResult=null;
43
+
}
44
+
setTimeout(startNotificationLoop,100);
45
+
}
46
+
47
+
(asyncfunction(){
34
48
Notification.requestPermission().then((result)=>{
35
49
if(result==='granted'){
36
50
startNotificationLoop();
@@ -52,24 +66,12 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
@@ -32,7 +32,7 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
@@ -30,7 +30,7 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
@@ -56,6 +56,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
0 commit comments