.
This commit is contained in:
+4
-4
@@ -1,12 +1,12 @@
|
||||
chrome.runtime.onInstalled.addListener(function() {
|
||||
chrome.storage.sync.set({color: '#3aa757'}, function() {
|
||||
chrome.runtime.onInstalled.addListener(function () {
|
||||
chrome.storage.sync.set({color: '#3aa757'}, function () {
|
||||
console.log("The color is green.");
|
||||
});
|
||||
|
||||
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
|
||||
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
|
||||
chrome.declarativeContent.onPageChanged.addRules([{
|
||||
conditions: [new chrome.declarativeContent.PageStateMatcher({
|
||||
pageUrl: {hostEquals: 'developer.chrome.com'},
|
||||
pageUrl: {hostEquals: 'youtube.com'},
|
||||
})
|
||||
],
|
||||
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}) => {
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user