-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.js
29 lines (26 loc) · 1.02 KB
/
error.js
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
29
var namespace = typeof chrome !== 'undefined' ? chrome : browser;
document.addEventListener('DOMContentLoaded', function() {
namespace.storage.sync.get(['mainColor', 'accentColor'], function(data) {
let themeStyle = document.createElement('style');
themeStyle.textContent = `
body {
background-color: ${data.mainColor};
color: ${data.accentColor};
}
`;
document.head.appendChild(themeStyle);
});
let params = new URLSearchParams(window.location.search);
let input = params.get('input');
if (input) {
let errorMessage = document.getElementById('errorMessage');
let searchQuerySpan = document.createElement('span');
searchQuerySpan.textContent = "\"" + decodeURIComponent(input) + "\" ";
searchQuerySpan.style.fontWeight = 'bold';
searchQuerySpan.style.fontStyle = 'italic';
errorMessage.prepend(searchQuerySpan);
}
setTimeout(function() {
window.close();
}, 2000);
});