Talus Posted March 19, 2018 Share Posted March 19, 2018 It would be nice if we could optionally get browser notifications when we receive a new message or notification. Some notifications could get spammy, so we'd need the ability to filter certain kinds of notifications. For example: show all baseball notifications, but hide trade notifications. 2 Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted March 22, 2018 Administrators Share Posted March 22, 2018 I want to do this, I haven't figured out how to do it yet. 2 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Dio Brando Posted March 22, 2018 Share Posted March 22, 2018 Seconding this, because this is one of those additions that would really make the experience better. Quote Link to comment Share on other sites More sharing options...
Dio Brando Posted March 23, 2018 Share Posted March 23, 2018 @Alex Quote Link to comment Share on other sites More sharing options...
Kyle N Posted March 24, 2018 Share Posted March 24, 2018 How do we enable them on chrome? Quote Link to comment Share on other sites More sharing options...
Kosonome Posted March 25, 2018 Share Posted March 25, 2018 I'm using most recent Firefox, and since update, I did not get any notification at all. Since you said that you didn't know how to use it and it's something that I could love to have, below is a little snippet of code in javascript that I used in another page and works there: var notify = function(text, url = '') { // if browser does not have notification object, just show a simple alert if (!("Notification" in window)) { alert('Notification: ' + text); return; } // if browser already gave permission to show notifications, generate the notification! if (Notification.permission === "granted") { generateNotification(text, url); return; } /* when browser didn't gave permission yet (like the first time), request the permission, once is granted, show some message */ if (Notification.permission !== 'denied') { Notification.requestPermission(function (permission) { if (permission === "granted") { /* below is a message that person accepted the notifications */ generateNotification('Notifications granted.', ''); /* below is the first notification message that player received */ generateNotification(text, url); return; } }); } }; var generateNotification = function(text, url) { var options = { body: text, /* inside icon key, you can put some image for showing inside notification */ icon: window.location.protocol + '//' + window.location.host + '/img/someimage.png' }; var notification = new Notification('Politics and War', options); /* if you use generateNotification("some notification", "http://politicsandwar.com/someurl"), if someone click inside the notification, it will redirect to this url. */ if (url) { notification.onclick = function(e) { e.preventDefault(); /* you can use _blank or _self for opening a new page or use current page */ window.open(url, '_blank'); }; } }; generateNotification("first notification", "https://politicsandwar.com/"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.