tabs.onRemoved and close the browser

208 views
Skip to first unread message

Pavel Aronovich

unread,
Sep 4, 2023, 9:43:47 AM9/4/23
to Chromium Extensions
Hi,

I use tabs.onRemoved to do the work I need. When the user closes the tab, I manage to create a duplicate of the tab by url (in order to execute scripts there and then it closes). 

But when you close the browser, it doesn't work. 
tabs.onRemoved works, but nothing can be done there anymore. Is there any solution to this problem (onbeforeunload, etc., please do not offer)? 
Does the chromium team plan to provide the developer with a simple mechanism for such cases?

Thanks.

Cuyler Stuwe

unread,
Sep 4, 2023, 10:17:57 PM9/4/23
to Pavel Aronovich, Chromium Extensions
You can’t prevent the user from closing the browser, just as you can’t prevent them from closing a tab.

I doubt there will ever be such a capability exposed to the extensions, platform since it could open the door to extremely annoying behavior on the part of malicious (or just bad-mannered) extensions.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/99ae6c6f-79d6-4df7-b45c-2e2847572d01n%40chromium.org.

Pavel Aronovich

unread,
Sep 5, 2023, 3:25:18 AM9/5/23
to Chromium Extensions, Cuyler Stuwe, Chromium Extensions, Pavel Aronovich
Hi,

I don't need to forbid the user to do anything. 
I need tabs.onRemoved to work the same way when closing the browser as when closing the tab. Or you need another API method to do the work when you close the browser.

Thanks.

вторник, 5 сентября 2023 г. в 05:17:57 UTC+3, Cuyler Stuwe:

Patrick Kettner

unread,
Sep 5, 2023, 3:31:02 AM9/5/23
to Pavel Aronovich, Chromium Extensions, Cuyler Stuwe
What is "the work you need"? Using something like navigator.beacon to guarantee sending a message to a backend service . Otherwise, the only thing I can think of that would be of any use is the `background` permission.

On Tue, Sep 5, 2023 at 3:25 PM Pavel Aronovich <pave...@gmail.com> wrote:
Hi,

I don't need to forbid the user to do anything. 
I need tabs.onRemoved to work the same way when closing the browser as when closing the tab. Or you need another API method to do the work when you close the browser.

Thanks.

вторник, 5 сентября 2023 г. в 05:17:57 UTC+3, Cuyler Stuwe:
You can’t prevent the user from closing the browser, just as you can’t prevent them from closing a tab.

I doubt there will ever be such a capability exposed to the extensions, platform since it could open the door to extremely annoying behavior on the part of malicious (or just bad-mannered) extensions.

On Mon, Sep 4, 2023 at 6:44 AM Pavel Aronovich <pave...@gmail.com> wrote:
Hi,

I use tabs.onRemoved to do the work I need. When the user closes the tab, I manage to create a duplicate of the tab by url (in order to execute scripts there and then it closes). 

But when you close the browser, it doesn't work. 
tabs.onRemoved works, but nothing can be done there anymore. Is there any solution to this problem (onbeforeunload, etc., please do not offer)? 
Does the chromium team plan to provide the developer with a simple mechanism for such cases?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/99ae6c6f-79d6-4df7-b45c-2e2847572d01n%40chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

Pavel Aronovich

unread,
Sep 5, 2023, 3:45:22 AM9/5/23
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Cuyler Stuwe, Pavel Aronovich
The thing is, I really want to use the extension API, and not use content script. We had an option using onbeforeunload. This is a bad approach.

I tried the "background" permission. The browser still closes and the tabs.onRemoved method does nothing.

вторник, 5 сентября 2023 г. в 10:31:02 UTC+3, Patrick Kettner:

Pavel Aronovich

unread,
Sep 5, 2023, 5:05:15 AM9/5/23
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Cuyler Stuwe, Pavel Aronovich
It seems "background" permission is working!

вторник, 5 сентября 2023 г. в 10:31:02 UTC+3, Patrick Kettner:
What is "the work you need"? Using something like navigator.beacon to guarantee sending a message to a backend service . Otherwise, the only thing I can think of that would be of any use is the `background` permission.

Pavel Aronovich

unread,
Sep 5, 2023, 1:56:43 PM9/5/23
to Chromium Extensions, Pavel Aronovich, Patrick Kettner, Chromium Extensions, Cuyler Stuwe
It works fine in Chrome, but Edge gives an error when running chrome.windows.create():  "window creation is restricted in standalone sidebar mode".
I tried different settings of the sidebar - nothing worked. Has anyone ever encountered such a thing?

вторник, 5 сентября 2023 г. в 12:05:15 UTC+3, Pavel Aronovich:

Jack Steam

unread,
Sep 22, 2023, 8:26:15 AM9/22/23
to Chromium Extensions, Pavel Aronovich, Patrick Kettner, Chromium Extensions, Cuyler Stuwe
> "window creation is restricted in standalone sidebar mode"
We just ran into this in Edge, it seems like a bug. Is there a place to file Edge bugs?

Pavel Aronovich

unread,
Sep 22, 2023, 8:38:02 AM9/22/23
to Chromium Extensions, Jack Steam, Pavel Aronovich, Patrick Kettner, Chromium Extensions, Cuyler Stuwe
https://github.com/microsoft/MicrosoftEdge-Extensions/issues/109


пятница, 22 сентября 2023 г. в 15:26:15 UTC+3, Jack Steam:

Pavel Aronovich

unread,
Nov 6, 2023, 12:59:52 PM11/6/23
to Chromium Extensions, Pavel Aronovich, Jack Steam, Patrick Kettner, Chromium Extensions, Cuyler Stuwe

Hi,

I see that this is fixed in the stable version 119.0.2151.44.


пятница, 22 сентября 2023 г. в 15:38:02 UTC+3, Pavel Aronovich:
Reply all
Reply to author
Forward
0 new messages