Grammalecte  Check-in [0eeca06c55]

Overview
Comment:[fx][bug] workaround for weird bug (from Firefox?) while loading gc_options which may be an empty object
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: 0eeca06c55b38f3ae755c3474f4c299ee6894ef887f9eceec29fd6a6df5b5ab5
User & Date: olr on 2018-03-07 13:41:59
Other Links: manifest | tags
Context
2018-03-07
13:57
[fx] main panel: better functions name check-in: 07d0ec19f5 user: olr tags: trunk, fx
13:41
[fx][bug] workaround for weird bug (from Firefox?) while loading gc_options which may be an empty object check-in: 0eeca06c55 user: olr tags: trunk, fx
13:27
[graphspell] helpers: Map/Object conversion: return null if null given as parameter check-in: 7ab6e5b571 user: olr tags: trunk, graphspell
Changes

Modified gc_lang/fr/webext/background.js from [1f59a4fda9] to [b1af0b858f].

86
87
88
89
90
91
92

93
94
95
96
97
98
99
100
101
102



















103
104
105
106
107
108
109
86
87
88
89
90
91
92
93










94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119







+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







            textarea: true,
            editablenode: true
        }});
    }
}

function initGrammarChecker (dSavedOptions) {
    try {
    let dOptions = (dSavedOptions.hasOwnProperty("gc_options")) ? dSavedOptions.gc_options : null;
    if (bChrome) {
        // JS crap again. Chrome can’t store Map object.
        dOptions = helpers.objectToMap(dOptions);
    }
    xGCEWorker.postMessage({
        sCommand: "init",
        dParam: {sExtensionPath: browser.extension.getURL(""), dOptions: dOptions, sContext: "Firefox"},
        dInfo: {}
    });
        let dOptions = (dSavedOptions.hasOwnProperty("gc_options")) ? dSavedOptions.gc_options : null;
        if (dOptions !== null && Object.getOwnPropertyNames(dOptions).length == 0) {
            console.log("# Error: the saved options was an empty object");
            dOptions = null;
        }
        if (bChrome) {
            // JS crap again. Chrome can’t store Map object.
            dOptions = helpers.objectToMap(dOptions);
        }
        xGCEWorker.postMessage({
            sCommand: "init",
            dParam: {sExtensionPath: browser.extension.getURL(""), dOptions: dOptions, sContext: "Firefox"},
            dInfo: {}
        });
    }
    catch (e) {
        console.log("initGrammarChecker failed");
        showError(e);
    }
}

function setSpellingDictionary (dSavedDictionary) {
    if (dSavedDictionary.hasOwnProperty("oExtendedDictionary")) {
        xGCEWorker.postMessage({
            sCommand: "setDictionary",
            dParam: { sType: "extended", oDict: dSavedDictionary["oExtendedDictionary"] },