Grammalecte  Check-in [0e2a49ac8c]

Overview
Comment:[fx] add search engine
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | webext2
Files: files | file ages | folders
SHA3-256: 0e2a49ac8c391309670668e08c84b2d4b8f1d8ad670e4146e9cfd4217d3d0cff
User & Date: olr on 2017-08-09 09:16:06
Other Links: branch diff | manifest | tags
Context
2017-08-09
18:11
[fx] SharedWorker attempt (not working in content script) + lexicographer panel check-in: 4e34f03093 user: olr tags: fx, webext2
09:16
[fx] add search engine check-in: 0e2a49ac8c user: olr tags: fx, webext2
07:40
[fr] nouveaux libellés pour les options du conjugueur check-in: 9aaa619491 user: olr tags: fr, webext2
Changes

Modified gc_lang/fr/webext/background.js from [d13b1b16d2] to [4837698c20].

   115    115   function onCreated(windowInfo) {
   116    116     console.log(`Created window: ${windowInfo.id}`);
   117    117   }
   118    118   
   119    119   function onError(error) {
   120    120     console.log(`Error: ${error}`);
   121    121   }
          122  +
          123  +let xConjWindow = null;
          124  +let xConjTab = null;
   122    125   
   123    126   browser.contextMenus.onClicked.addListener(function (xInfo, xTab) {
   124    127       // xInfo = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextMenus/OnClickData
   125    128       // xTab = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/Tab
   126    129       console.log(xInfo);
   127    130       console.log(xTab);
   128    131       console.log("Item " + xInfo.menuItemId + " clicked in tab " + xTab.id);
................................................................................
   133    136               break;
   134    137           case "lexicographer":
   135    138               if (xInfo.selectionText) {
   136    139                   xGCEWorker.postMessage(["getListOfTokens", {sText: xInfo.selectionText}]);
   137    140               }
   138    141               break;
   139    142           case "conjugueur_panel":
   140         -            var xConjWindow = browser.windows.create({
          143  +            xConjWindow = browser.windows.create({
   141    144                   url: browser.extension.getURL("panel/conjugueur.html"),
   142    145                   type: "detached_panel",
   143    146                   width: 710,
   144    147                   height: 980
   145    148               });
   146    149               xConjWindow.then(onCreated, onError);
   147    150               break;
   148    151           case "conjugueur_tab":
   149         -            var xConjTab = browser.tabs.create({
          152  +            xConjTab = browser.tabs.create({
   150    153                   url: browser.extension.getURL("panel/conjugueur.html"),
   151    154                   pinned: true
   152    155               });
   153    156               xConjTab.then(onCreated, onError);
   154    157               break;
   155    158       }
   156    159   

Modified gc_lang/fr/webext/manifest.json from [de1e478a6e] to [f9bf321344].

     3      3     "name": "Grammalecte [fr]",
     4      4     "short_name": "Grammalecte [fr]",
     5      5     "version": "0.6",
     6      6   
     7      7     "applications": {
     8      8       "gecko": {
     9      9         "id": "French-GC@grammalecte.net",
    10         -      "strict_min_version": "54.0"
           10  +      "strict_min_version": "55.0"
    11     11       }
    12     12     },
    13     13   
    14     14     "author": "Olivier R.",
    15     15     "homepage_url": "https://grammalecte.net",
    16     16   
    17     17     "description": "Correcteur grammatical pour le français.",
................................................................................
    39     39       "grammalecte/fr/mfsp_data.json",
    40     40       "grammalecte/fr/phonet_data.json",
    41     41       "grammalecte/fr/tests_data.json"
    42     42     ],
    43     43     "permissions": [
    44     44       "activeTab",
    45     45       "contextMenus"
    46         -  ]
           46  +  ],
           47  +  "chrome_settings_overrides": {
           48  +    "search_provider": {
           49  +      "name": "Grammalecte",
           50  +      "search_url": "https://www.dicollecte.org/dictionary.php?prj=fr&lemma={searchTerms}",
           51  +      "keyword": "disc",
           52  +      "favicon_url": "https://www.dicollecte.org/favicon.ico"
           53  +    }
           54  +  }
    47     55   }