From 4d021c6d801d997e7b89cd24ebfd2ef9806b551d Mon Sep 17 00:00:00 2001 From: Sriram Hariharan Date: Sat, 7 Jul 2018 13:04:54 -0500 Subject: [PATCH] Rate my prof link --- background.js | 9 +++++++++ content.js | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/background.js b/background.js index 8f518b2d..082ad879 100644 --- a/background.js +++ b/background.js @@ -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); diff --git a/content.js b/content.js index bc090208..2c6a3356 100644 --- a/content.js +++ b/content.js @@ -1,5 +1,6 @@ var grades; +var rmpLink; var coursename; var profname; var profinit; @@ -11,7 +12,7 @@ $(document).ready( function() { loadDataBase(); //make heading $("table thead th:nth-child(8)").after('Dist'); - var modhtml = '