Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@undef rule 1 of using lighthouse is website should be under SSL protocol so try with https://
-
@undef I'm learning Web Notification API, it's code should be in app.js, I haven't minified it yet
-
@undef Notification Web API, Something like
var serviceWorkerNotification = function () {
Notification.requestPermission(function (status) {
try {
if (status == "granted") {
navigator.serviceWorker.getRegistration().then(function (reg) {
var options = {
body: "Hello World",
icon: "favicon/apple-icon.png",
data: {
dateOfArrival: Date.now(),
primaryKey: 1
},
actions: [{
action: 'explore',
title: 'Explore this new world'
},
{
action: 'close',
title: 'Close notification',
},
]
};
reg.showNotification('Testing Options', options);
});
}
} catch (error) {
console.error("This is the error", error);
}
})
}
https://developer.mozilla.org/en-US... -
@undef interesting, but Notification is different from SSL, I'll add this to index.html
-
@undef I do not follow, I'm learning about Notification Web API right now that's why it is there..I think we've shifted from the entire topic?
-
@undef yeah, right now it's static, but in future I'm planning to add a panel which pushes notification from user inputs, for that will need to optimize code and make it scalable, So let's say I have to push a notification, I'll add the title, body, image(optional) and other optional things, I think PHP shall help me
-
mindev5366yDon't know why it didn't work for you. I played around with it and Vue and had no problems whatsoever.
-
@DawidCyron I've already dropped the project as it's almost finished, don't want to invest more time in it, I've got gulpfile.js problems now, it's minifying js files properly
Related Rants
So I did this little experiment PWA caching and service worker which caches entire website (js/css/html) [It's a small website]. Now I do not understand the concept of PWA caching entirely because when I 'Add it to Home screen' it becomes an app as expected but when I turn off the internet and then open the app it requires the internet.
What in fucking ass, why won't you just render those html pages which are cached ?
rant
serviceworkerm
pwa