MozillaZine

[WebExt] How to catch an error from native application?

Talk about add-ons and extension development.
leska
 
Posts: 127
Joined: January 20th, 2008, 4:04 am

Post Posted January 18th, 2017, 7:40 am

The problem is that Firefox Native Messaging API works a bit differently then in Chrome. If
Code: Select all
port = chrome.runtime.connectNative('some.host.name')
which is not exists then we've an error. In Chrome the error message can be found in
Code: Select all
chrome.runtime.lastError
. But in Firefox we don't have an error here. The error is just raised from the module:
Code: Select all
No such native application 'some.host.name  NativeMessaging.jsm:188
. Does anyone know how to catch this error in my code?

morat
 
Posts: 2226
Joined: February 3rd, 2009, 6:29 pm

Post Posted January 18th, 2017, 9:48 am


leska
 
Posts: 127
Joined: January 20th, 2008, 4:04 am

Post Posted January 18th, 2017, 10:10 am

Cool, thank you!

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests