Since Opera supports the Chrome extension API, it is almost possible to run a full-featured Chrome extension on this browser. However there are still some missing features in the API.
Is there a simple and efficient way to check if an extension is currently running on Opera or Google Chrome?
The specific use case I'm facing is when invoking chrome.notifications.create
: on Google Chrome it is possible to set a buttons
attribute to add buttons to it. Opera does not support it and instead of ignoring the attribute, it throws an error:
Unchecked runtime.lastError while running notifications.create: Adding buttons to notifications is not supported.
So I need a way to check the browser beforehand instead of handling the error.