1

I made a NodeJS script a while ago that can read Chromium notifications by reading the LevelDB database where they're stored. I use it to have more granularity when handling notifications, and to sync them with my phone.

Problem is, in the coming months Chromium browsers will drop support for MV2, and with it some extensions I made, so I'll need to move to Firefox soon.

So I need to know if/where Firefox stores its push notifications, so I can make the script compatible with Firefox, otherwise I'll have to leave Chrome running in the background just for the script to work, which isn't ideal.

I've tried going through the Firefox source code to see if I can find a way of intercepting/reading the notifications, but I don't know C++, so that's a shot in the dark.

I did find these files which could be important:

Update 2024-03-18:

I managed to extract alert.js from omni.ja at the root of the installation folder and modify it to intercept the notifications. (Literally just accessing window.arguments inside prefillAlertInfo)

Now the problem is, it seems that the URL that you get directed to when you click on a notification is not accessible in that file. When a user clicks on a notification, gAlertListener.observe(null, "alertclickcallback", gAlertCookie) gets called and that creates a new tab on the browser with that URL. I tried to read gAlertListener.observe but all I got was [native code], and I don't know where to go from here.

Update 2024-03-19:

Found a file called notificationstore.json at the root of the profile folder. A lot of information about the notifications is kept there. But I still can't get the callback URL. I tried decoding the data field of the notifications, which seem to be Base64 encoded, using Buffer.from(<encoded data string>).toString() in NodeJS, but that outputs some really malformed JSON, the callback URL seems to be there, but it's hard to extract it programmatically that way.

Does anyone know how to decode the data field? I don't want to paste one of them here in case it contains sensitive information.

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Mar 17 at 22:29

0

You must log in to answer this question.

Browse other questions tagged .