Skip to content
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

Fix delay caused by network api #49

Open
Tracked by #24
alxclark opened this issue Nov 20, 2023 · 1 comment
Open
Tracked by #24

Fix delay caused by network api #49

alxclark opened this issue Nov 20, 2023 · 1 comment

Comments

@alxclark
Copy link
Owner

alxclark commented Nov 20, 2023

There seems to be some delay in the dev tools when the webpage connects but somehow the dev tools disconnects itself and it takes a while for it to be ready and receive/send a connection event to the content-script. This should be instant every time since the dev tools panel does not change and is persisted through page refresh.

Looks like the network api is the culprit here, during a page reload, the dev tools panel has to process dozens/hundreds of network requests while also trying to execute the onConnect even for each page reload that attempted to connect to the dev tools. The amount of requests induces a large delay before the dev tools panel can process the next onConnect listener.

So how do we fix this ?

  • requestIdleCallback
    • Not very reliable, sometimes the browser will offload for a very long time if the webpage is very active. This gives very poor UX.
  • Debounced getHAR
    • HAR always return what is in the network tab
    • Con: It respects the preserve log option from the network tab which could differ from the persistence setting in aside. There could be a layer on top of the api to filter out requests made before the page load. After initial load, it would be costly to re-query the full HAR and filter it again. It also respects the recording state in the network tab, so it could come out empty.
@alxclark alxclark mentioned this issue Nov 20, 2023
25 tasks
@alxclark
Copy link
Owner Author

For now, it hasn't been solved, but the network feature is behind the network capability which reduces the green path when using aside without network integrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant