Rate my prof link

This commit is contained in:
Sriram Hariharan
2018-07-07 13:04:54 -05:00
parent 0ab1463cfd
commit 4d021c6d80
2 changed files with 21 additions and 1 deletions

View File

@@ -1,4 +1,13 @@
chrome.runtime.onMessage.addListener(function(request, sender, response) {
chrome.runtime.onMessage.addListener(
function (request, sender, sendResponse) {
console.log(sender.tab ?
"from a content script:" + sender.tab.url :
"from the extension");
if (request.greeting == "hello")
sendResponse({ farewell: "goodbye" });
});
const xhr = new XMLHttpRequest();
const method = request.method ? request.method.toUpperCase() : "GET";
xhr.open(method, request.url, true);