I am creating Firefox addons that works like search in chrome. How can i use browser.tabs.create() function with 'url' option?
I have read this article. But In here, there is no documentation of How to use this tab creation with variable url.
//code for CMcontentScript.js-start
var tabs = require("../sdk/tabs");
self.on("click", function(node, data) {
textContent = window.getSelection().toString();
var searchURL = google.com?searchtid=" + textContent;
tabs.open(searchURL);//In here i want to know how we can add variable url to 'url' option
});
//code for CMcontentScript.js-ends
//code for index.js-start
searchMenu = cm.Item({
label: "Search With enadoc",
data: setURL,
context: cm.SelectionContext(),
image: self.data.url("./icon-16.png"),
contentScriptFile: "./CMcontentScript.js"
});
//code for index.js-ends