-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcontent.js
More file actions
28 lines (23 loc) · 1.08 KB
/
content.js
File metadata and controls
28 lines (23 loc) · 1.08 KB
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
//Psst: you don't need to wait for the window to load.
//chrome extension content files wait for this by default
console.log("extension is working.");
console.log(window.location.href);
//Replace whole body with video
// document.getElementsByTagName("body")[0].innerHTML = `<iframe width="560" height="315" src="https://www.youtube.com/embed/xfr64zoBTAQ" frameborder="0" allowfullscreen></iframe>`;
//Nic Cage Gifs
// $("img").attr("src","http://akns-images.eonline.com/eol_images/Entire_Site/201506/rs_500x213-150106140225-tumblr_lx7an6a7pT1r4etbjo1_r1_500.gif");
//being sneaky with the video...
// $("body").append(`<iframe src="https://www.youtube.com/embed/xfr64zoBTAQ?autoplay=1" frameborder="0" allowfullscreen></iframe>`);
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request) {
console.log("Getting message from the icon click!");
console.log(request);
localStorage.setItem("stefExtension", "extension made data");
console.log(localStorage.getItem("stefExtension"));
sendResponse({
response: "Message received"
});
}
}
);