Answer the question
In order to leave comments, you need to log in
How to get value from textarea?
I'm trying to write a simple extension for Firefox:
var cm = require("sdk/context-menu");
var tabs = require("sdk/tabs");
var self = require("sdk/self");
cm.Item({
label: "search",
image: self.data.url("search.ico"),
//context:
data: "http://search/?q=",
contentScript:
'self.on("click", function (node, data) {' +
' var text = window.getSelection().toString();' +
' var searchURL = data + text;' +
' self.postMessage(searchURL);' +
'});',
onMessage: function(searchURL) {
tabs.open(searchURL);
}
});
Answer the question
In order to leave comments, you need to log in
And here is the answer: stackoverflow.com/questions/275761/how-to-get-sele...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question