AutoReadFile/js/read.js

16 lines
586 B
JavaScript

chrome.extension.onMessage.addListener(
function (request, sender, sendResponse) {
var msg = "Recv Commond [" + request.action + "] from (" + request.from + ")";
sendResponse(msg);
console.log(msg);
if (request.action == "cs_read_page") {
var rd = document.getElementById('toRead');
rd.click();
chrome.runtime.sendMessage({ from: "content_scripts", to: "background", action: 'bg_click_table', tabId: request.tabId }, function (response) {
console.log(response);
});
}
}
);