MozillaZine


how to find a reason for runtime.Port (native) disconnect

Talk about add-ons and extension development.
arkiof
 
Posts: 2
Joined: April 20th, 2021, 12:53 pm

Post Posted May 4th, 2021, 10:24 am

Hi.
In my temporary loaded web extension to FF I have the following piece of the code (after calling connectNative)
port.onDisconnect.addListener((p) => {
if(p.error)
console.log(`Native port disconnected due to an error: ${p.error.message}`);
else
console.log("native port -disconnected");
});
logging on browser console gives the following

native port -disconnected

So there is no error, and no part of NativeHost or webExtension calls port.disconnect()
How to find the reason for disconnection? Documentation talking about destroying page that created connection, but this background script doesn't belong any page and loaded on web Ext injection and stays all the time.
Please advise how to debug?

DanRaisch
Moderator

User avatar
 
Posts: 125475
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted May 4th, 2021, 11:41 am

Moving to Extension Development.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests