Grammalecte  Check-in [da4865ce6b]

Overview
Comment:[fx] WebExt: adaptation to Chrome: conj initialisation (again)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: da4865ce6b9c11d500e6eebcdf26fd246825c94e8570ca4c7bb419c86e80459a
User & Date: olr on 2017-09-27 11:26:48
Other Links: manifest | tags
Context
2017-09-27
11:45
[fx] WebExt: secure function createNode() check-in: 57f14062ba user: olr tags: fx, trunk
11:26
[fx] WebExt: adaptation to Chrome: conj initialisation (again) check-in: da4865ce6b user: olr tags: fx, trunk
11:21
[fx] WebExt: adaptation to Chrome: conj initialisation check-in: 898e9ae864 user: olr tags: fx, trunk
Changes

Modified gc_lang/fr/modules-js/conj.js from [cf19538b1a] to [57af7c3c72].

   482    482           }
   483    483           return (this.dConj.get(":PQ").get(":Q4")) ? this.dConj.get(":PQ").get(":Q4") : this.dConj.get(":PQ").get(":Q1");
   484    484       }
   485    485   }
   486    486   
   487    487   
   488    488   // Initialization
   489         -if (!conj.bInit && (typeof(browser) !== 'undefined' || typeof(chrome) !== 'undefined')) {
   490         -    // WebExtension (but not in Worker)
          489  +if (!conj.bInit && typeof(browser) !== 'undefined') {
          490  +    // WebExtension Standard (but not in Worker)
   491    491       conj.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/conj_data.json")));
          492  +} else if (!conj.bInit && typeof(chrome) !== 'undefined') {
          493  +    // WebExtension Chrome (but not in Worker)
          494  +    conj.init(helpers.loadFile(chrome.extension.getURL("grammalecte/fr/conj_data.json")));
   492    495   } else if (!conj.bInit && typeof(require) !== 'undefined') {
   493    496       // Add-on SDK and Thunderbird
   494    497       conj.init(helpers.loadFile("resource://grammalecte/fr/conj_data.json"));
   495    498   } else if (!conj.bInit && typeof(self) !== 'undefined' && typeof(self.port) !== 'undefined' && typeof(self.port.on) !== "undefined") {
   496    499       // used within Firefox content script (conjugation panel).
   497    500       // can’t load JSON from here, so we do it in ui.js and send it here.
   498    501       self.port.on("provideConjData", function (sJSONData) {