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

Performance improvement suggestion for 2 userscripts #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emvaized
Copy link

@emvaized emvaized commented Jul 24, 2023

During my testing of scripts favicon_in_urlbar.uc.js and tab_label_in_urlbar.uc.js I figured out, that DOMContentLoaded, load and TabOpen event listeners are not really neccessary for scripts to function. Basically, 99% of cases are covered by TabAttrModified event listener (if not all) — at least in the current Firefox version I tested (v115).

Moreover, by removing TabOpen listener and adding a check to react only to selected tabs changes, scripts became significally easier on browser startup. Without these changes they processed whatever many tabs user had automatically restored on browser startup — each sending few TabOpen and TabAttrModified events.

I guess, the only downside is — tab_label_in_urlbar.uc.js will temporary show url in the label widget for new tabs which are still loading and don't have any label yet.

@Aris-t2
Copy link
Owner

Aris-t2 commented Jul 29, 2023

I agree, removing unnecessary DOMContentLoaded, load and TabOpen listeners improves performance.
The script favicon_in_urlbar.uc.js had a few other issues needed to be resolved, before uploading a new version.

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

Successfully merging this pull request may close these issues.

2 participants