Nonsensical error when trying to do basic notifications in Firefox, as per their own example code

by guestghost   Last Updated October 10, 2019 02:01 AM - source

I get this error:

ReferenceError: browser is not defined

The code:

<script>
    browser.notifications.create(123, {  "type": "basic", "title": "testing", "message": "testing body" } );
</script>

Exactly as shown on this example page on how to use notifications, by Mozilla: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/notifications/create

No notification pops up. That stupid error is just logged. What?

It's not even a new feature... it's supported since all the way back to Firefox v45. Allegedly. According to the same page with the non-functioning JavaScript code...

Tags : firefox


Related Questions


Remove or add items to firefox open menu

Updated March 22, 2019 00:01 AM