-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.js
executable file
·33 lines (27 loc) · 922 Bytes
/
background.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
// // This is the javascript that will be running constantly in the background
// // HOW TO CONSOLE LOG TO BACKGROUND PAGE
// function handleClick() {
// var bkg = chrome.extension.getBackgroundPage();
// bkg.console.log('fooy-gooy');
// }
// // Recieve messages from the content script
// chrome.runtime.onMessage.addListener((message) => {
// // Send messages to the content script
// alert(message);
// chrome.tabs.getSelected(null, (tab) => {
// chrome.tabs.sendMessage(tab.id, "From Background");
// });
// });
// // Local storage
// window.onload = () => {
// chrome.storage.local.get(["variable"], (items) => {
// // Create a variable if one does not exist
// if (!items["variable"]) {
// variable = true;
// }
// // Reassign or manipulate data
// else {
// variable = !variable;
// }
// });
// };