psychopy.org | Reference | Downloads | Github

Error in Pavlovia: Cannot read property 'getSelected' of undefined at popup.js:7

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);
});

Hi everyone,
I still could not find a solution to this. Anyone has any suggestions?