summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/search/content/engineManager.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-19 06:10:46 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-19 06:10:46 +0200
commit810cdf0fc5d7fbf91db0c977fe5c82be61162fd4 (patch)
treed6e30b4e6d5a460534c66c061d6c8286edeff256 /application/palemoon/components/search/content/engineManager.js
parent8abaa8c76090efdc6c91f4522cc7d37b34967e47 (diff)
downloadUXP-810cdf0fc5d7fbf91db0c977fe5c82be61162fd4.tar
UXP-810cdf0fc5d7fbf91db0c977fe5c82be61162fd4.tar.gz
UXP-810cdf0fc5d7fbf91db0c977fe5c82be61162fd4.tar.lz
UXP-810cdf0fc5d7fbf91db0c977fe5c82be61162fd4.tar.xz
UXP-810cdf0fc5d7fbf91db0c977fe5c82be61162fd4.zip
[PALEMOON] Engine Manager throws a warning (deprecated)
Issue #121
Diffstat (limited to 'application/palemoon/components/search/content/engineManager.js')
-rw-r--r--application/palemoon/components/search/content/engineManager.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/application/palemoon/components/search/content/engineManager.js b/application/palemoon/components/search/content/engineManager.js
index 92b6d59b7..e6c22fee0 100644
--- a/application/palemoon/components/search/content/engineManager.js
+++ b/application/palemoon/components/search/content/engineManager.js
@@ -2,7 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
+ "resource://gre/modules/PlacesUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Task",
+ "resource://gre/modules/Task.jsm");
const Ci = Components.interfaces;
const Cc = Components.classes;
@@ -105,7 +110,7 @@ var gEngineManagerDialog = {
document.getElementById("engineList").focus();
},
- editKeyword: function engineManager_editKeyword() {
+ editKeyword: Task.async(function* () {
var selectedEngine = gEngineView.selectedEngine;
if (!selectedEngine)
return;
@@ -121,12 +126,8 @@ var gEngineManagerDialog = {
var dupName = "";
if (alias.value != "") {
- try {
- let bmserv = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- if (bmserv.getURIForKeyword(alias.value))
- bduplicate = true;
- } catch(ex) {}
+ // Check for duplicates in Places keywords.
+ bduplicate = !!(yield PlacesUtils.keywords.fetch(alias.value));
// Check for duplicates in changes we haven't committed yet
let engines = gEngineView._engineStore.engines;
@@ -154,7 +155,7 @@ var gEngineManagerDialog = {
break;
}
}
- },
+ }),
onSelect: function engineManager_onSelect() {
// Buttons only work if an engine is selected and it's not the last engine,