Is there a way to suspend payment during heavy manipulations with the DOM?

I need to do heavy DOM manipulations on the entire web page document in the add-in that I am writing. I would like to minimize transitions, so that only one update occurs for all my manipulations. Removing the body element, doing the manipulations, and then pasting it again is not an option, because it overestimates all the elements <script>. Currently, I set the visibility of the body to 'none'before manipulations and restore the display value after. I'm not sure if this is the best way to handle this.

Is there a better way? Of course, this may be Firefox specific code. This is, after all, a Firefox add-on.

+5
source share
1 answer

Gecko is actually pretty good at suppressing unnecessary changes yourself (i.e. you might be better off not bothering with it), unless you make between the various changes, you also request information that requires the layout to be up to date ( e.g. item positions or sizes, getComputedStyle, etc.)

+1
source

All Articles