Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing port.onDisconnect to determine when a Chrome extension is uninstalled / disabled
    primarykey
    data
    text
    <p>I know that Chrome extension API doesn't have an official way of determining when a user uninstalls your extension (which is a shame).</p> <p>I am using the port.onDisconnect listener from my content-script page after connecting to the background page to determine when a user uninstalls/disables my extension. According to the docs port.onDisconnect should only fire when the extension doesn't exist anymore (or when port.disconnect is explicitly called from the background page) which should cover the disable / uninstall scenario.</p> <p>This actually works perfectly on my machine. Whenever I uninstall or disable my extension, port.onDisconnect is fired as it's supposed to (once per open tab). The problem is I am seeing this event fired from MANY of my actual users. I am 99% sure that not this many users are disabling / uninstalling my extension (I see them perform other tasks later on with my extension and my extension installation numbers doesn't show that many uninstalls).</p> <p>This leads me to believe that there is some other condition that fires port.onDisconnect other than disabling/uninstalling an extension. I cannot reproduce this at all on my machine. On my machine, port.onDisconnect is only fired when I disable/uninstall the extension and I don't call port.disconnect explicitly from my background page anywhere.</p> <p>So my question is: what could be the condition(s) that fires port.onDisconnect other than the user disabling/uninstalling an extension? I thought a version upgrade of the extension could cause this behavior but I tested it on my machine and I don't think that's it.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload