I tworks
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ chrome.runtime.onInstalled.addListener(function () {
|
|||||||
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: 'youtube.com'},
|
pageUrl: {hostEquals: 'www.youtube.com'},
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
actions: [new chrome.declarativeContent.ShowPageAction()]
|
actions: [new chrome.declarativeContent.ShowPageAction()]
|
||||||
|
|||||||
+7
-1
@@ -1,9 +1,14 @@
|
|||||||
function applyDefaultStyle(element) {
|
function applyDefaultStyle(element) {
|
||||||
element.style.position = "fixed";
|
element.style.position = "fixed";
|
||||||
element.style.zIndex = 1000;
|
element.style.zIndex = 99999999;
|
||||||
|
element.style.color = "#FFF";
|
||||||
|
element.style.backgroundColor = "rgba(0, 0, 0, 0.5)";
|
||||||
|
element.style.padding = "0.25em 0.5ch";
|
||||||
|
element.style.fontSize = "3vmax";
|
||||||
}
|
}
|
||||||
|
|
||||||
let mCalorieCount = document.createElement("div");
|
let mCalorieCount = document.createElement("div");
|
||||||
|
mCalorieCount.id = "ykonsole-calorie-count";
|
||||||
applyDefaultStyle(mCalorieCount);
|
applyDefaultStyle(mCalorieCount);
|
||||||
mCalorieCount.style.left = 0;
|
mCalorieCount.style.left = 0;
|
||||||
mCalorieCount.style.top = 0;
|
mCalorieCount.style.top = 0;
|
||||||
@@ -15,6 +20,7 @@ mCalorieCount.innerHTML = `
|
|||||||
document.body.append(mCalorieCount);
|
document.body.append(mCalorieCount);
|
||||||
|
|
||||||
let mResults = document.createElement("div");
|
let mResults = document.createElement("div");
|
||||||
|
mResults.id = "ykonsole-result";
|
||||||
applyDefaultStyle(mResults);
|
applyDefaultStyle(mResults);
|
||||||
mResults.style.right = 0;
|
mResults.style.right = 0;
|
||||||
mResults.style.bottom = 0;
|
mResults.style.bottom = 0;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"storage",
|
"storage",
|
||||||
"activeTab",
|
"activeTab",
|
||||||
"declarativeContent",
|
"declarativeContent",
|
||||||
|
"https://www.youtube.com/",
|
||||||
"https://indigo.stian-aune.com/"
|
"https://indigo.stian-aune.com/"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user