Shorten push notification title

  • Thread starter Thread starter smileyhead
  • Start date Start date
  • Views Views 329
  • Replies Replies 4
  • Likes Likes 4

smileyhead

I like cute stuff.
Member
Deer 🦌
Joined
Aug 31, 2015
Messages
4,914
Solutions
2
Reaction score
17,282
Trophies
6
Age
25
Location
Budakeszi, Hungary
Website
szija.hu
XP
11,988
Country
Hungary
I have recently re-enabled push notifications for the site and have some feedback regarding the titles they are using.

Whenever I get a notification on my phone, they also pop up full-screen on my smartwatch, so that I can quickly glance at them. The problem is, the title for GBAtemp notifications is so extremely long, that they take up most of the screen space, leaving the actual content of the alert mostly inaccessible, unless I scroll down (see image 1). The titles are so long, they even get cut off on my phone (see image 2).

screenshot-2025-06-29-19-30-21.png
Screenshot_20250629-193334.png


I think these could be shortened to just ‘New alert’ which would retain the same amount of information currently present in the title, but without the additional fluff – ‘GBAtemp.net’ probably doesn't need to be included, either, since the domain name is already present in a different field of the notification.

Additionally, I have read in the Google Chrome documentation* that there is a possibility of including up to two buttons in a notification. Perhaps a ‘Mark as read’ button could be put here?

___
*I am assuming the page containing information for web notifications should be generic enough to concern any browser's notifications in general…?
 
It's possible. https://developer.mozilla.org/en-US/docs/Web/API/Notification/actions (Previous dev doc was for Chrome extensions). If the GBA devs don't do this change, you may have another option, at least on Chrome / Firefox on a desktop: Userscripts. You could hijack the Notification API calls, replace the notification body string via RegExp, and even add your own buttons (though without server-implementation, button outcomes will be limited to client functionality). I'd help but all I have is a Vita, void of Notification support.
 
It just occured to me that the Push API makes its Notification calls inside a Service Worker - an elevated context immune from my solution, at least from the Users' side. But for fun, here's a simple hijacking of alert:
Code:
javascript:(function(){var _alert=alert; alert=function(s_msg){_alert(s_msg+' - Nyan');}; alert('Test')})();
 

Site & Scene News

Popular threads in this forum