I am a beginner, created a chrome extension(.crx) which is working fine on my machine. But when i install the same file in other machine's chrome, the javascript in content.js and popup.js files is not working fine.
popup.js: Sends message to content.js to get how many rows are in pending state. Content.js: Counts rows which are in pending state and sends response.
popup.js:
function GetNoOfLinksClicked(e) {
chrome.tabs.query({"status":"complete","windowId":chrome.windows.WINDOW_ID_CURRENT,"active":true}, function(tabs){
chrome.tabs.sendMessage(
tabs[0].id,
{from: 'CheckRows', subject: 'NoOfRowsPending'},
refreshNoRowsPending);
});
}
function refreshNoRowsPending(noOfPendingRows) {
document.getElementById('pendingRows').textContent = noOfPendingRows;
}
content.js:
chrome.runtime.onMessage.addListener(function (msg, sender, response) {
if ((msg.from === 'CheckRows') && (msg.subject === 'NoOfRowsPending')) {
var noOfPendingRows= 0;
$(".row_self").each(function() {
var status = $(this).find("td").eq(4).text();
if(status == "Pending"){
noOfPendingRows++;
}
});
response(noOfPendingRows);
}
}
.crx is working fine and displaying count if i run if on chrome on which i have developed it, but not getting the count when i run it on chrome of other machine. Could someone help me ?