Send sqlresult from background to content script

79 views Asked by At

When i send sqlresult from background page to content script (before sending screen) result before sending in console

it loss data and transforming to result after receiving in console

it happends only with SqlResultSet, other vriables and simnple array`s sending normally

code in background.js

chrome.tabs.query({active: true, currentWindow: true}, function(tabs){
    chrome.tabs.sendMessage(tabs[0].id, {
        action: "getRight",
        res: results,
        leng: len }, function(response) {});
});

code in check.js (content page)

chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {
    switch(msg.action) {
        case "getRight":
          console.log(msg.res);
          break;
    }
});

What is the problem?

1

There are 1 answers

0
user2735696 On BEST ANSWER

I personally found the correct solution of the problem

insteal of sending

res: results

i will send

res: results.rows

and receiving received sesult in console (content script)