-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevtools.js
More file actions
36 lines (33 loc) · 863 Bytes
/
devtools.js
File metadata and controls
36 lines (33 loc) · 863 Bytes
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
30
31
32
33
34
35
36
const CHECK_TSOFT_META_SCRIPT = `(function () {
try {
var meta = document.querySelector('meta[name="copyright"]');
if (!meta) {
return false;
}
var content = meta.getAttribute("content") || "";
return content.toLowerCase().includes("t-soft");
} catch (error) {
return false;
}
})();`;
chrome.devtools.inspectedWindow.eval(
CHECK_TSOFT_META_SCRIPT,
(result, isException) => {
if (isException) {
console.warn("Tema paneli kontrolü yapılırken hata oluştu.", isException);
return;
}
if (!result) {
console.info("T-Soft meta etiketi bulunamadı, tema paneli açılmadı.");
return;
}
chrome.devtools.panels.create(
"T-Soft Devtools",
"icons/icon48.png",
"panel.html",
function (panel) {
console.log("Theme Panel created");
}
);
}
);