Fixing "Error: Frame with ID 0 was removed"

2,908 views
Skip to first unread message

Uğur

unread,
Sep 9, 2022, 2:35:28 AM9/9/22
to Chromium Extensions
Hi everyone,

My extension gives this error but couldn't catch the case exactly and stack trace doesn't give much information. which line etc.errx.jpg
there is only one code group related to Frame, I am  not sure whether it causes the error or not.
errx2.jpg

There is a lot of code related to tabs, creating, deleting etc.

Any recommendation for me? 

wOxxOm

unread,
Sep 9, 2022, 10:30:39 AM9/9/22
to Chromium Extensions, ugur.kell...@gmail.com
Frame id 0 is a technical term for the main page of the tab. In modern Chrome it can be swapped from a prerendered page or from a back/forward cache after you got tabId but before the script is actually injected. The solution is to use documentId of the tab instead of its tabId. This property is present in `sender` parameter of chrome.runtime.onMessage, in `port.sender` for onConnect, also in most webNavigation and webRequest events, see the documentation.

Cana Ben Haim

unread,
Jul 3, 2023, 7:14:21 AM7/3/23
to Chromium Extensions, wOxxOm
Hi,
I'm having a similar error: "Frame with ID 0 is showing error page" while trying to inject scripts to a tab using chrome.scripting.executeScript:
Screenshot 2023-07-03 at 14.09.40.png

Is this error originate from the same problem?
If it is, can you widen your explanation about the frame id 0? I couldn't get to the bottom of it.
Otherwise, what could be the reason for this error?
Thank you😊

wOxxOm

unread,
Jul 3, 2023, 3:55:37 PM7/3/23
to Chromium Extensions, Cana Ben Haim, wOxxOm
The error message says the tab is showing an error e.g. the site cannot be reached or the tab just crashed.

Cana Ben Haim

unread,
Jul 4, 2023, 2:09:12 AM7/4/23
to Chromium Extensions, wOxxOm, Cana Ben Haim
Thank you so much😊

Almog Idisis

unread,
Jul 4, 2023, 4:35:44 AM7/4/23
to Chromium Extensions, wOxxOm
That's interesting.
How should one handle this situation?
Is it a situation where the tab is "gone" and we should give up on him?
On Monday, July 3, 2023 at 10:55:37 PM UTC+3 wOxxOm wrote:
Reply all
Reply to author
Forward
0 new messages