.
This commit is contained in:
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
chrome.runtime.onInstalled.addListener(function() {
|
chrome.runtime.onInstalled.addListener(function () {
|
||||||
chrome.storage.sync.set({color: '#3aa757'}, function() {
|
chrome.storage.sync.set({color: '#3aa757'}, function () {
|
||||||
console.log("The color is green.");
|
console.log("The color is green.");
|
||||||
});
|
});
|
||||||
|
|
||||||
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
|
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
|
||||||
chrome.declarativeContent.onPageChanged.addRules([{
|
chrome.declarativeContent.onPageChanged.addRules([{
|
||||||
conditions: [new chrome.declarativeContent.PageStateMatcher({
|
conditions: [new chrome.declarativeContent.PageStateMatcher({
|
||||||
pageUrl: {hostEquals: 'developer.chrome.com'},
|
pageUrl: {hostEquals: 'youtube.com'},
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
actions: [new chrome.declarativeContent.ShowPageAction()]
|
actions: [new chrome.declarativeContent.ShowPageAction()]
|
||||||
|
|||||||
+32
-1
@@ -1 +1,32 @@
|
|||||||
alert("Surprise motherfuckers");
|
function applyDefaultStyle(element) {
|
||||||
|
element.style.position = "fixed";
|
||||||
|
element.style.zIndex = 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mCalorieCount = document.createElement("div");
|
||||||
|
applyDefaultStyle(mCalorieCount);
|
||||||
|
mCalorieCount.style.left = 0;
|
||||||
|
mCalorieCount.style.top = 0;
|
||||||
|
mCalorieCount.innerHTML = `
|
||||||
|
<b>25</b>:<b>23</b>
|
||||||
|
<br/>
|
||||||
|
<b>883</b> kal
|
||||||
|
`;
|
||||||
|
document.body.append(mCalorieCount);
|
||||||
|
|
||||||
|
let mResults = document.createElement("div");
|
||||||
|
applyDefaultStyle(mResults);
|
||||||
|
mResults.style.right = 0;
|
||||||
|
mResults.style.bottom = 0;
|
||||||
|
mResults.style.textAlign = "right";
|
||||||
|
mResults.innerHTML = `
|
||||||
|
5 161<br/>
|
||||||
|
10 332<br/>
|
||||||
|
15 490<br/>
|
||||||
|
20 712<br/>
|
||||||
|
25 875<br/>
|
||||||
|
`;
|
||||||
|
document.body.append(mResults);
|
||||||
|
|
||||||
|
chrome.storage.sync.get('color', ({color}) => {
|
||||||
|
});
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ chrome.storage.sync.get('color', function(data) {
|
|||||||
changeColor.setAttribute('value', data.color);
|
changeColor.setAttribute('value', data.color);
|
||||||
});
|
});
|
||||||
|
|
||||||
let mOverlay = document.createElement("div");
|
|
||||||
mOverlay.innerHTML = "<b>QUQ</b>";
|
|
||||||
|
|
||||||
changeColor.onclick = function(element) {
|
changeColor.onclick = function(element) {
|
||||||
// TODO: Add settings to STORAGE
|
// TODO: Add settings to STORAGE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user