I'm trying to create an etension for Google Chrome. I am monitoring page text selection and i want the popup page to recieve the selected text when i click on the popup button.
Is there a way to pass variables to a popup? I understand, that messging doen't work for closed popups, so what should i do?
preguntado el 27 de agosto de 11 a las 20:08
Once a text is selected send it to a background page where you would store it in lets say
textSelection global variable. Once popup is opened you can access this variable with:
var selection = chrome.extension.getBackgroundPage().textSelection;
(you can access any variable and function from a background page directly, without requests)
Your question can't be concisely answered, but I recommend you look here and read through some of the code samples: