Chrome Extension

chrome.tabs.executeScript( {
	code: "window.getSelection().toString();"
}, function(selection) {
	// selected contains text including line breaks
	var selected = selection[0];
});
chrome.browserAction.setBadgeText({text: "10+"}); // We have 10+ unread items.
var color = "red";
var changeColor = function(response, sender, sendResponse) {
  this.color = response.data;
};

chrome.runtime.sendMessage({method: "getLocalStorage", key: "favColor"}, 
    changeColor.bind(this));

Similiar Collections