a/background.js b/background.js
1
/*
1
/*
2
 *      RecollWebext - WebExtension - Background Page
2
 *      RecollWebext - WebExtension - Background Page
3
 *
3
 *
4
 *      A lot of code was copied from or inspired by the savepage-WE
4
 *      A lot of code was copied from or inspired by the Save Page WE
5
 *      extension.
5
 *      extension.
6
 *
6
 *
7
 *      Copyright (C) 2017 jfd@recoll.org
7
 *      Copyright (C) 2017 jfd@recoll.org
8
 *      Copyright (C) 2016-2017 DW-dev
8
 *      Copyright (C) 2016-2017 DW-dev
9
 *
9
 *
...
...
253
            chrome.browserAction.setIcon({tabId: tabId,
253
            chrome.browserAction.setIcon({tabId: tabId,
254
                                          path: "icon16-disabled.png"}); 
254
                                          path: "icon16-disabled.png"}); 
255
        }        
255
        }        
256
        chrome.browserAction.setTitle(
256
        chrome.browserAction.setTitle(
257
            {tabId: tabId,
257
            {tabId: tabId,
258
             title: "Save Page WE - cannot be used with this page" });
258
             title: "Recoll WE - cannot be used with this page" });
259
        
259
        
260
        chrome.contextMenus.update("indexnow",{enabled: false });
260
        chrome.contextMenus.update("indexnow",{enabled: false });
261
        chrome.contextMenus.update("separator", {enabled: true });
261
        chrome.contextMenus.update("separator", {enabled: true });
262
        chrome.contextMenus.update("sitealways",{enabled: false });
262
        chrome.contextMenus.update("sitealways",{enabled: false });
263
        chrome.contextMenus.update("sitenever",{enabled: false });
263
        chrome.contextMenus.update("sitenever",{enabled: false });
...
...
265
        chrome.browserAction.enable(tabId);
265
        chrome.browserAction.enable(tabId);
266
        
266
        
267
        if (isFirefox && ffVersion <= 54)
267
        if (isFirefox && ffVersion <= 54)
268
            chrome.browserAction.setIcon({ tabId: tabId, path: "icon16.png"});
268
            chrome.browserAction.setIcon({ tabId: tabId, path: "icon16.png"});
269
        
269
        
270
        chrome.browserAction.setTitle({ tabId: tabId, title: "Save Page WE" });
270
        chrome.browserAction.setTitle({ tabId: tabId, title: "Recoll WE" });
271
        
271
        
272
        chrome.contextMenus.update("indexnow",{enabled: true});
272
        chrome.contextMenus.update("indexnow",{enabled: true});
273
        chrome.contextMenus.update("separator", {enabled: true});
273
        chrome.contextMenus.update("separator", {enabled: true});
274
        chrome.contextMenus.update("sitealways",{enabled: false});
274
        chrome.contextMenus.update("sitealways",{enabled: false});
275
        chrome.contextMenus.update("sitenever",{enabled: false});
275
        chrome.contextMenus.update("sitenever",{enabled: false});
...
...
277
        chrome.browserAction.enable(tabId);
277
        chrome.browserAction.enable(tabId);
278
        
278
        
279
        if (isFirefox && ffVersion <= 54)
279
        if (isFirefox && ffVersion <= 54)
280
            chrome.browserAction.setIcon({ tabId: tabId, path: "icon16.png"});
280
            chrome.browserAction.setIcon({ tabId: tabId, path: "icon16.png"});
281
        
281
        
282
        chrome.browserAction.setTitle({ tabId: tabId, title: "Save Page WE" });
282
        chrome.browserAction.setTitle({ tabId: tabId, title: "Recoll WE" });
283
        chrome.contextMenus.update("indexnow",{enabled: true});
283
        chrome.contextMenus.update("indexnow",{enabled: true});
284
        chrome.contextMenus.update("separator", {enabled: true});
284
        chrome.contextMenus.update("separator", {enabled: true});
285
        chrome.contextMenus.update("sitealways",{enabled: true});
285
        chrome.contextMenus.update("sitealways",{enabled: true});
286
        chrome.contextMenus.update("sitenever",{enabled: true});
286
        chrome.contextMenus.update("sitenever",{enabled: true});
287
    }
287
    }