chrome extension unload event in background js

1.3k views Asked by At

I have created a chrome extension which is connected to Native messaging application. Native messaging app needs to know if the extension is unchecked or unloaded. Is there any event by which i can catch that the extension is uninstalled or unchecked? So that i can send message to my native messaging app to notify

1

There are 1 answers

0
dominik On

This can simply be detected if reading from STDIN when listening for messages from the browser in the native messaging host fails (e.g. fread returns not the buffer length passed in). Google Chrome disconnects STDIN when it unloads the extension.