It is just a small relaxation...New Tobin Paradigm wrote: ↑2021-03-17, 21:31See your drive-by tinkering can be useful for more than extensions
store page crashing browser
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.
This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.
Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.
This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.
Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
-
- Keeps coming back
- Posts: 939
- Joined: 2021-01-26, 11:18
Re: store page crashing browser
-
- Pale Moon guru
- Posts: 35647
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: store page crashing browser
Yeah the script is wrong and will cause a recursive loop, unless there is a specific "optimization" in place that won't call the mutationobserver if the style set is the same as what was already there (and I don't think that is specced).
Otherwise what happens in that script is this:
Style in page is set by js -> mutationobserver is called because style is set to a value -> mutation observer code sets the style -> mutationobserver is called because style is set to a value -> mutation observer code sets the style -> ...
i.e.: the code in the mutationobserver triggers the observer itself through the set action, and there is no check performed if the style is already at the desired value. This kind of programmer error is actually fairly common and you always have to be careful about it when you deal with observers (as in don't make code inside the observer function trigger the observer again).
Otherwise what happens in that script is this:
Style in page is set by js -> mutationobserver is called because style is set to a value -> mutation observer code sets the style -> mutationobserver is called because style is set to a value -> mutation observer code sets the style -> ...
i.e.: the code in the mutationobserver triggers the observer itself through the set action, and there is no check performed if the style is already at the desired value. This kind of programmer error is actually fairly common and you always have to be careful about it when you deal with observers (as in don't make code inside the observer function trigger the observer again).
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Keeps coming back
- Posts: 939
- Joined: 2021-01-26, 11:18
Re: store page crashing browser
In MS Edge and IE the observer fires only once.
Actually implies that the observer should fires when the attribute is changed, not when just set.
In any case, the page is frozen for this reason, and this is no longer the first case here.
Actually implies that the observer should fires when the attribute is changed, not when just set.
In any case, the page is frozen for this reason, and this is no longer the first case here.
-
- Pale Moon guru
- Posts: 35647
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: store page crashing browser
*sigh* with "set" i mean the action of writing something to the value. (as in a "setter") not going from "unset" to "having a value"
Why do people make me have to repeat myself?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite