chrome.runtime.connect reconnects every minute

67 views
Skip to first unread message

Pavel Aronovich

unread,
Oct 30, 2023, 7:22:44 AM10/30/23
to Chromium Extensions
Hi,

A port is created in the content script. On the onDisconnect event, the port is created anew. Recently I noticed that the first time the port lives for more than 5 minutes, and then a minute. Is this a new behavior?

Screenshot_1.png

Pavel Aronovich

unread,
Oct 30, 2023, 7:46:59 AM10/30/23
to Chromium Extensions, Pavel Aronovich
probably falling asleep SW

понедельник, 30 октября 2023 г. в 14:22:44 UTC+3, Pavel Aronovich:

Pavel Aronovich

unread,
Oct 30, 2023, 7:52:29 AM10/30/23
to Chromium Extensions, Pavel Aronovich
Although it seems that the port should support the life of SW

понедельник, 30 октября 2023 г. в 14:46:59 UTC+3, Pavel Aronovich:

wOxxOm

unread,
Oct 30, 2023, 10:11:10 AM10/30/23
to Chromium Extensions, Pavel Aronovich
A port is probably considered active only for 30 seconds since its last received message, then the idle timeout adds another 30 seconds, so if you send messages differently is would explain the difference you observed, otherwise it may be a bug.

Pavel Aronovich

unread,
Oct 31, 2023, 5:26:08 AM10/31/23
to Chromium Extensions, wOxxOm, Pavel Aronovich
Yes, it is, there are no messages. But previously, the port always lived for about 4-5 minutes.

понедельник, 30 октября 2023 г. в 17:11:10 UTC+3, wOxxOm:
Reply all
Reply to author
Forward
0 new messages