URL of experiment: https://gitlab.pavlovia.org/pinartoptas/navontask
Description of the problem:
Uncaught TypeError: Cannot read property ‘getSelected’ of undefined at popup.js:7
Hi all,
I synced my experiment with Pavlovia and got this error. Any idea how to fix this?
Part of the code that gives the error is below.
function onSelectedText(response){
document.getElementById('main').src =
"http://chrome.tureng.com/Search?searchTerm=" + encodeURIComponent(response.selected_text);
};
chrome.tabs.getSelected(null, function(tab) {
chrome.tabs.sendRequest(tab.id, {action: "get_selected_text"}, onSelectedText);
});