Grammalecte  Check-in [4fad50f750]

Overview
Comment:[fx] observePage: makes Twitter crash when hitting on backspace (Why?) -> disable it for now
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: 4fad50f750b819e57ed0b36f36f8b0f970794f1e369eb3b0a116f42b368bc7e6
User & Date: olr on 2020-03-28 18:52:44
Other Links: manifest | tags
Context
2020-03-28
19:08
[fx] gc panel: change spelling error color check-in: 398c378342 user: olr tags: trunk, fx
18:52
[fx] observePage: makes Twitter crash when hitting on backspace (Why?) -> disable it for now check-in: 4fad50f750 user: olr tags: trunk, fx
15:51
[fr] ajustements et faux positif check-in: 4c8b7d95bc user: olr tags: trunk, fr
Changes

Modified gc_lang/fr/webext/content_scripts/init.js from [ba5504f4c4] to [f2766d89f6].

117
118
119
120
121
122
123
124
125
126
127
128





129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
        // When a textarea is added via jascript we add the buttons
        let that = this;
        this.xObserver = new MutationObserver(function (lMutations) {
            lMutations.forEach(function (xMutation) {
                if (that.oOptions) {
                    for (let i = 0;  i < xMutation.addedNodes.length;  i++) {
                        let xNode = xMutation.addedNodes[i];
                        if (((xNode.tagName == "TEXTAREA"  &&  that.oOptions.textarea  &&  xNode.getAttribute("spellcheck") !== "false") || (xNode.isContentEditable  &&  that.oOptions.editablenode))
                            &&  that._isEligibleNode(xNode)) {
                            oGrammalecte.lButton.push(new GrammalecteButton(oGrammalecte.nButton, xNode));
                            oGrammalecte.nButton += 1;
                        }





                        else if (xNode.getElementsByTagName  &&  that.oOptions.textarea) {
                            for (let xSubNode of xNode.getElementsByTagName("textarea")) {
                                if (that._isEligibleNode(xSubNode)  &&  xSubNode.getAttribute("spellcheck") !== "false") {
                                    oGrammalecte.lButton.push(new GrammalecteButton(oGrammalecte.nButton, xSubNode));
                                    oGrammalecte.nButton += 1;
                                }
                            }
                        }
                        else if (xNode.querySelectorAll  &&  that.oOptions.editablenode) {
                            for (let xSubNode of xNode.querySelectorAll("[contenteditable]")) {
                                if (that._isEligibleNode(xSubNode)) {
                                    oGrammalecte.lButton.push(new GrammalecteButton(oGrammalecte.nButton, xSubNode));
                                    oGrammalecte.nButton += 1;
                                }
                            }
                        }
                    }
                }
            });
        });
        this.xObserver.observe(document.body, { childList: true, subtree: true });
    },








|
<



>
>
>
>
>








|






|







117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
        // When a textarea is added via jascript we add the buttons
        let that = this;
        this.xObserver = new MutationObserver(function (lMutations) {
            lMutations.forEach(function (xMutation) {
                if (that.oOptions) {
                    for (let i = 0;  i < xMutation.addedNodes.length;  i++) {
                        let xNode = xMutation.addedNodes[i];
                        if (xNode.tagName == "TEXTAREA"  &&  that.oOptions.textarea  &&  xNode.getAttribute("spellcheck") !== "false" &&  that._isEligibleNode(xNode)) {

                            oGrammalecte.lButton.push(new GrammalecteButton(oGrammalecte.nButton, xNode));
                            oGrammalecte.nButton += 1;
                        }
                        /*else if (xNode.isContentEditable  &&  that.oOptions.editablenode  &&  that._isEligibleNode(xNode)) {
                            // this makes Twitter crash when hitting backspace button
                            oGrammalecte.lButton.push(new GrammalecteButton(oGrammalecte.nButton, xNode));
                            oGrammalecte.nButton += 1;
                        }*/
                        else if (xNode.getElementsByTagName  &&  that.oOptions.textarea) {
                            for (let xSubNode of xNode.getElementsByTagName("textarea")) {
                                if (that._isEligibleNode(xSubNode)  &&  xSubNode.getAttribute("spellcheck") !== "false") {
                                    oGrammalecte.lButton.push(new GrammalecteButton(oGrammalecte.nButton, xSubNode));
                                    oGrammalecte.nButton += 1;
                                }
                            }
                        }
                        /*else if (xNode.querySelectorAll  &&  that.oOptions.editablenode) {
                            for (let xSubNode of xNode.querySelectorAll("[contenteditable]")) {
                                if (that._isEligibleNode(xSubNode)) {
                                    oGrammalecte.lButton.push(new GrammalecteButton(oGrammalecte.nButton, xSubNode));
                                    oGrammalecte.nButton += 1;
                                }
                            }
                        }*/
                    }
                }
            });
        });
        this.xObserver.observe(document.body, { childList: true, subtree: true });
    },