-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.js
More file actions
34 lines (31 loc) · 1.17 KB
/
content.js
File metadata and controls
34 lines (31 loc) · 1.17 KB
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
const url = location.href;
// 「確認済みにする」ボタンを探す
const checkButton = document.querySelector('input[type="image"][name="action_FreePage_checkingstatusmod_check"][title="確認済みにする"]');
// ボタンが見つかればクリックする
if (checkButton) {
checkButton.click(); // ボタンをクリック
console.log("Button clicked");
} else {
console.log("Button not found");
}
//font-size: 0pxを探す
const isQueryPage = /https:\/\/ct\.ritsumei\.ac\.jp\/ct\/course_\d+_query/.test(url);
if (isQueryPage) {
const all = document.querySelectorAll('*');
const zeroFontElements = [];
all.forEach((el) => {
const fs = getComputedStyle(el).fontSize;
if (fs == '0px') {
zeroFontElements.push(el.innerText);
el.remove();
}
});
if (zeroFontElements.length > 0) {
console.log("Hidden text found");
console.log('font-size:0px の要素数:', zeroFontElements.length);
console.log(zeroFontElements);
alert(
`このページに font-size:0px の隠しテキストが ${zeroFontElements.length} 個見つかりました。\n`
);
}
}