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

Adding mutationObserver without checking if site is on whitelist first #10

Open
AidanSpeakss opened this issue Feb 14, 2022 · 0 comments
Assignees
Labels
performance improvement Changes that can be made to improve performance

Comments

@AidanSpeakss
Copy link
Owner

It seems I could make a performance improvement by only adding the mutation observer if a site is not on the whitelist, this way the mutation observer is never called on whitelisted sites.

Line 85 to 97 in background.js

const mutationObserver = new MutationObserver(function (mutations) {
    mutations.forEach(function (mutation) {
        if(mutation.target.hasChildNodes())
            childrenEater(mutation.target);
        else
            piiSearch(mutation.target);
    });
});
@AidanSpeakss AidanSpeakss added the performance improvement Changes that can be made to improve performance label Feb 14, 2022
@AidanSpeakss AidanSpeakss self-assigned this Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance improvement Changes that can be made to improve performance
Projects
None yet
Development

No branches or pull requests

1 participant