Commit 8d0d919e authored by Raine Makelainen's avatar Raine Makelainen

[embedlite-components] Add selected text and search uri to message payload. Contributes to JB#6623

parent fe094b98
......@@ -98,7 +98,9 @@ EmbedLiteSearchEngine.prototype = {
case "setdefault": {
var engine = Services.search.getEngineByName(data.name);
if (engine) {
// Update currentEngine as well when default search engine is updated.
Services.search.defaultEngine = engine;
Services.search.currentEngine = engine;
}
break;
}
......
......@@ -236,6 +236,14 @@ SelectionPrototype.prototype = {
this._cache.updateEnd = aUpdateEnd;
this._cache.updateCaret = aUpdateCaret || false;
this._cache.targetIsEditable = this._targetIsEditable;
this._cache.text = this._getSelectedText();
let searchEngine = Services.search.currentEngine;
let searchUri = "";
if (searchEngine) {
searchUri = Services.search.currentEngine.getSubmission(this._cache.text).uri.spec;
}
this._cache.searchUri = searchUri;
// Snap to word when content is not editable
if (this._cache.src == "start") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment