-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension sidebar load time/reliability #430
Comments
I just tried to reproduce the problem using the release build and didn't have a problem (loading is fast, and the panel always loads properly): https://github.com/pixiebrix/pixiebrix-extension/actions/runs/916635393 I think it's still worth looking into this issue though as having it get stuck in a loading state is annoying during development |
I tried loading I think this is most of all a "huge bundle" issue. On my fast computer I get the DOM ready event at 1.3s and the In the production build I'm already seeing a more reasonable 400ms and 470ms respectively. This page totals 4.8MB. |
@fregante I'm closing this issue because it works in the production build and also seems to be working better in development with the recent webpack/dependency changes. Will re-open as necessary |
I thought of a possible improvement: Don't inject the whole content script just to add the iframe. Is this doable? Is the content script used for anything else other than the injection in this case? My idea would be to inject a tiny file which is probably something along the lines of: const sidebar = select(…)
if (sidebar) {
sidebar.remove();
document.documentElement.marginLeft -= SIDEBAR_WIDTH_PX;
} else {
document.body.insertAdjacentHTML('beforeEnd', '<iframe id="pixiebrix-frame" etc>')
document.documentElement.marginLeft += SIDEBAR_WIDTH_PX;
} This would definitely speed up injecting as the browser does not need to evaluate the whole content script + wait for communication just to open the sidebar. It would also completely avoid this issue since the background page would have "direct" access over the page (by calling |
Steps to reproduce
actions/context-panel
panel extension via the Workshop. For reproducing, you can just attach a Markdown brick for the bodyExpected behavior
Actual behavior
Discussion
The text was updated successfully, but these errors were encountered: