Unpacked extension sometimes misbehaving

244 views
Skip to first unread message

DjSt3rios

unread,
Apr 4, 2023, 12:16:11 PM4/4/23
to Chromium Extensions
Sometimes I send the unpacked version of an extension for users to test it before publishing it to chrome store, and many times it doesn't work properly and they have to click the re-load icon to work properly. I am wondering if this is a problem with the extension itself or Google Chrome. Has anyone else noticed this issue with an unpacked version of an extension or is my extension the problem? 😑
Problems that users occur: Popup being empty, content scripts not working etc.

Patrick Kettner

unread,
Apr 4, 2023, 12:19:05 PM4/4/23
to DjSt3rios, Chromium Extensions
Without more information, it really isn’t easy to diagnose this. Does it happened to all users? On every update? Can you share the source?

On Tue, Apr 4, 2023 at 12:16 PM DjSt3rios <djst...@gmail.com> wrote:
Sometimes I send the unpacked version of an extension for users to test it before publishing it to chrome store, and many times it doesn't work properly and they have to click the re-load icon to work properly. I am wondering if this is a problem with the extension itself or Google Chrome. Has anyone else noticed this issue with an unpacked version of an extension or is my extension the problem? 😑
Problems that users occur: Popup being empty, content scripts not working etc.

--
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/277bf6b8-ff7e-4478-bc6f-b129ef15810cn%40chromium.org.

viktor stolbin

unread,
Apr 4, 2023, 2:21:45 PM4/4/23
to DjSt3rios, Chromium Extensions
I’ve noticed, once extension is reloaded from external directory, it takes few refreshes of pages if using content scripts. Looks like caching issue. I recommend all my users to click Reload button on extensions dashboard page few times as well as refreshing active pages few times.

On Tue, Apr 4, 2023 at 12:16 PM DjSt3rios <djst...@gmail.com> wrote:
Sometimes I send the unpacked version of an extension for users to test it before publishing it to chrome store, and many times it doesn't work properly and they have to click the re-load icon to work properly. I am wondering if this is a problem with the extension itself or Google Chrome. Has anyone else noticed this issue with an unpacked version of an extension or is my extension the problem? 😑
Problems that users occur: Popup being empty, content scripts not working etc.

--

DjSt3rios

unread,
Apr 5, 2023, 11:12:13 PM4/5/23
to Chromium Extensions, viktor stolbin, Chromium Extensions, DjSt3rios
This does not happen to all users, and is not consistent at all. It works great for me, but some do report this issue nonetheless. Unfortunately I cannot share the source code 😞
I am leaning towards chrome not loading it properly 🤔

wOxxOm

unread,
Apr 6, 2023, 4:42:29 AM4/6/23
to Chromium Extensions, DjSt3rios, viktor stolbin, Chromium Extensions
Things like that are typically caused by an antivirus.

Simeon Vincent

unread,
Apr 6, 2023, 2:31:32 PM4/6/23
to wOxxOm, Chromium Extensions, DjSt3rios, viktor stolbin
DjSt3rios, when you say "once extension is reloaded from external directory", do you mean it's being loaded from a network drive or something similar?

For the most part, Chrome does not expect the contents of an extension to change while it is running. This applies to unpacked extensions as well. 

Normally, Chrome will periodically check with CWS for new versions of the currently installed extensions. If a new version is available, Chrome will download it, unpack it, (when appropriate) reload the extension, and finally dispatch a runtime.onInstalled event. When working with unpacked extensions, Chrome doesn't have a reliable external signal for when it should reload an extension, so the user has to manually signal when to reload by clicking the reload button on the chrome://extensions page.

That is all somewhat complicated by how and when the browser loads and caches extension files. In some cases, files are always fetched from disk. For example, the HTML for an extension's popup should reflect what is currently on disk while an extension's background script will not automatically pick up changes on disk while the browser is running.

Finally, the way a user installs new versions of the extension may impact if and how problems appear. For example, I just observed on macOS that a content script will not update if you load an unpacked extension, then replace the contents of the extension's directory with the updated files, but it will update if you drag and drop the extension's directory into the chrome://extensions page. Assuming you have declared a key in your manifest, the second approach will trigger Chrome's update handling logic while the first one will not.

Simeon - @dotproto


Reply all
Reply to author
Forward
0 new messages