Skip to content

Commit 8e7dd96

Browse files
committed
Error hotfix
Fixed "resources must be listed in the web_accessible_resources..."
1 parent 04333a0 commit 8e7dd96

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

chrome/TcNo_snackbar.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

chrome/inj.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,24 @@ window.addEventListener('load', function () {
2525
TcNo_RDA_Fp();
2626
}
2727
});
28+
var style = (function() {
29+
var style = document.createElement("style");
30+
style.appendChild(document.createTextNode(""));
31+
document.head.appendChild(style);
32+
return style;
33+
})();
2834
function addStylesheet(){
29-
var s = document.createElement('link');
30-
s.type = "text/css";
31-
s.rel = "stylesheet";
32-
s.href = chrome.extension.getURL('TcNo_snackbar.css');
33-
s.onload = function() {
34-
this.remove();
35-
};
36-
(document.head || document.documentElement).appendChild(s);
35+
var css = document.createElement('style');
36+
css.type = 'text/css';
37+
38+
var snackbar_styles =`#snackbar{visibility:hidden;min-width:250px;background-color:#230B16;color:#fff;text-align:center;border:solid 4px #DE2A2A;padding:16px;position:fixed;z-index:1;left:50%;transform:translateX(-50%);bottom:30px;-webkit-box-shadow: 0px 0px 20px 5px #230B16;-moz-box-shadow: 0px 0px 20px 5px #230B16;box-shadow: 0px 0px 20px 5px #230B16;}#snackbar.show{visibility:visible;-webkit-animation:fadein 0.5s,fadeout .5s 2.5s;animation:fadein 0.5s}#snackbar.fadeout{bottom:0;opacity:0;animation:fadeout .5s 0s}@-webkit-keyframes fadein{from{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@keyframes fadein{from{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@-webkit-keyframes fadeout{from{bottom:30px;opacity:1}to{bottom:0;opacity:0}}@keyframes fadeout{from{bottom:30px;opacity:1}to{bottom:0;opacity:0}}#snackbar h1{color:#9146ff;font-size:2em}#snackbar span{color:#efebe0;font-size:1.3em}#snackbar a{color:#aa4734!important;font-size:1.5em;text-decoration:underline}`;
3739

40+
if (css.styleSheet)
41+
css.styleSheet.cssText = snackbar_styles;
42+
else
43+
css.appendChild(document.createTextNode(snackbar_styles));
44+
document.getElementsByTagName("head")[0].appendChild(css);
45+
3846
var d = document.createElement('div');
3947
d.id = "snackbar";
4048
d.innerHTML = "TcNo RDA Loaded!";
@@ -178,12 +186,6 @@ async function TcNo_RDA_Fp(){
178186
}
179187
});
180188

181-
var style = (function() {
182-
var style = document.createElement("style");
183-
style.appendChild(document.createTextNode(""));
184-
document.head.appendChild(style);
185-
return style;
186-
})();
187189
style.sheet.insertRule('.drop-item{padding: 16px;}', 0);
188190
style.sheet.insertRule('.ProgressBar{width: 100%;height: .5rem;background-color:#222;margin-top:0.5rem}', 0);
189191
style.sheet.insertRule('.ProgressBar div{height: .25rem;background-color:#9147ff;}', 0);

chrome/manifest.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33
"name": "TcNo Rust Drop Assistant",
44
"description": "An easy way to view available twitch drops for Rust",
5-
"version": "1.3",
5+
"version": "1.3.1",
66
"homepage_url": "https://tcno.co/",
77

88
"browser_action": {
@@ -28,8 +28,7 @@
2828
{
2929
"run_at" :"document_end",
3030
"matches": ["*://*.twitch.tv/drops/inventory*", "*://*.twitch.facepunch.com/*"],
31-
"js": ["inj.js"],
32-
"css": ["TcNo_snackbar.css"]
31+
"js": ["inj.js"]
3332
}
3433
]
3534
}

firefox/TcNo_snackbar.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

firefox/inj.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,24 @@ window.addEventListener('load', function () {
2525
TcNo_RDA_Fp();
2626
}
2727
});
28+
var style = (function() {
29+
var style = document.createElement("style");
30+
style.appendChild(document.createTextNode(""));
31+
document.head.appendChild(style);
32+
return style;
33+
})();
2834
function addStylesheet(){
29-
var s = document.createElement('link');
30-
s.type = "text/css";
31-
s.rel = "stylesheet";
32-
s.href = chrome.extension.getURL('TcNo_snackbar.css');
33-
s.onload = function() {
34-
this.remove();
35-
};
36-
(document.head || document.documentElement).appendChild(s);
35+
var css = document.createElement('style');
36+
css.type = 'text/css';
37+
38+
var snackbar_styles =`#snackbar{visibility:hidden;min-width:250px;background-color:#230B16;color:#fff;text-align:center;border:solid 4px #DE2A2A;padding:16px;position:fixed;z-index:1;left:50%;transform:translateX(-50%);bottom:30px;-webkit-box-shadow: 0px 0px 20px 5px #230B16;-moz-box-shadow: 0px 0px 20px 5px #230B16;box-shadow: 0px 0px 20px 5px #230B16;}#snackbar.show{visibility:visible;-webkit-animation:fadein 0.5s,fadeout .5s 2.5s;animation:fadein 0.5s}#snackbar.fadeout{bottom:0;opacity:0;animation:fadeout .5s 0s}@-webkit-keyframes fadein{from{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@keyframes fadein{from{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@-webkit-keyframes fadeout{from{bottom:30px;opacity:1}to{bottom:0;opacity:0}}@keyframes fadeout{from{bottom:30px;opacity:1}to{bottom:0;opacity:0}}#snackbar h1{color:#9146ff;font-size:2em}#snackbar span{color:#efebe0;font-size:1.3em}#snackbar a{color:#aa4734!important;font-size:1.5em;text-decoration:underline}`;
3739

40+
if (css.styleSheet)
41+
css.styleSheet.cssText = snackbar_styles;
42+
else
43+
css.appendChild(document.createTextNode(snackbar_styles));
44+
document.getElementsByTagName("head")[0].appendChild(css);
45+
3846
var d = document.createElement('div');
3947
d.id = "snackbar";
4048
d.innerHTML = "TcNo RDA Loaded!";
@@ -178,12 +186,6 @@ async function TcNo_RDA_Fp(){
178186
}
179187
});
180188

181-
var style = (function() {
182-
var style = document.createElement("style");
183-
style.appendChild(document.createTextNode(""));
184-
document.head.appendChild(style);
185-
return style;
186-
})();
187189
style.sheet.insertRule('.drop-item{padding: 16px;}', 0);
188190
style.sheet.insertRule('.ProgressBar{width: 100%;height: .5rem;background-color:#222;margin-top:0.5rem}', 0);
189191
style.sheet.insertRule('.ProgressBar div{height: .25rem;background-color:#9147ff;}', 0);

firefox/manifest.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "TcNo Rust Drop Assistant",
44
"author": "Wesley Pyburn",
55
"description": "An easy way to view available twitch drops for Rust",
6-
"version": "1.3",
6+
"version": "1.3.1",
77
"homepage_url": "https://tcno.co/",
88

99
"browser_action": {
@@ -24,8 +24,7 @@
2424
{
2525
"run_at" :"document_end",
2626
"matches": ["*://*.twitch.tv/drops/inventory*", "*://*.twitch.facepunch.com/*"],
27-
"js": ["inj.js"],
28-
"css": ["TcNo_snackbar.css"]
27+
"js": ["inj.js"]
2928
}
3029
]
3130
}

0 commit comments

Comments
 (0)