-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheventPage.js
44 lines (35 loc) · 1.18 KB
/
eventPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// console.log("Event page loaded");
// /*chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
// console.log(message);
// });*/
// var url = "";
// chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
// switch(request.type) {
// case "dom-loaded":
// // alert(request.data.myProperty);
// url = request.data.myProperty;
// // alert(url);
// break;
// }
// return true;
// });
// chrome.runtime.getBackgroundPage(function callback) {
// url = request.data.myProperty;
// console.log(url);
// var chartDiv = document.getElementById("chart");
// chartDiv.appendChild("url");
// }
var url;
chrome.runtime.onMessage.addListener(function(message,sender,sendResponse){
// if(message.method == 'setUrl')
// console.log('Setting Url: ' + message.url);
// url = message.url;
// else if(message.method == 'getUrl')
// console.log('Getting url: ' + url);
// sendResponse(url);
var urlValue = message.urlVal;
// alert(message.urlVal);
// alert(localStorage['urlVal']);
// alert(message);
// sendResponse({urlVal: urlValue, word:'FUCK!'});
});