Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
v1.3 修复了并发漏洞
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehver committed Oct 26, 2022
1 parent b4fdef1 commit 38fb8fe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion #README/README-ja.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<img src="https://github.com/SynRGB/Pixiv-ForceSafeMode/raw/main/%23README/icon/256.png" width="20%"/>
<h1>Pixiv-ワンタッチセキュリティモード <code>v1.2</code></h1>
<h1>Pixiv-ワンタッチセキュリティモード <code>v1.3</code></h1>
<p>
<a href='https://github.com/SynRGB/Pixiv-ForceSafeMode'><img src="https://img.shields.io/badge/-GitHub-3A3A3A?style=flat&amp;logo=GitHub&amp;logoColor=white" referrerpolicy="no-referrer" alt="GitHub"></a>
<a href='https://greasyfork.org/zh-CN/scripts/453648-pixiv-forcesafemode'><img src="https://img.shields.io/badge/-GreasyFork-670000?style=flat&amp;logo=tampermonkey&amp;logoColor=white" referrerpolicy="no-referrer" alt="GreasyFork"></a>
Expand Down
2 changes: 1 addition & 1 deletion #README/README-zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<img src="https://github.com/SynRGB/Pixiv-ForceSafeMode/raw/main/%23README/icon/256.png" width="20%"/>
<h1>Pixiv-一键强制和谐 <code>v1.2</code></h1>
<h1>Pixiv-一键强制和谐 <code>v1.3</code></h1>
<p>
<a href='https://github.com/SynRGB/Pixiv-ForceSafeMode'><img src="https://img.shields.io/badge/-GitHub-3A3A3A?style=flat&amp;logo=GitHub&amp;logoColor=white" referrerpolicy="no-referrer" alt="GitHub"></a>
<a href='https://greasyfork.org/zh-CN/scripts/453648-pixiv-forcesafemode'><img src="https://img.shields.io/badge/-GreasyFork-670000?style=flat&amp;logo=tampermonkey&amp;logoColor=white" referrerpolicy="no-referrer" alt="GreasyFork"></a>
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<img src="https://github.com/SynRGB/Pixiv-ForceSafeMode/raw/main/%23README/icon/256.png" width="20%"/>
<h1>Pixiv-ForceSafeMode <code>v1.2</code></h1>
<h1>Pixiv-ForceSafeMode <code>v1.3</code></h1>
<p>
<a href='https://github.com/SynRGB/Pixiv-ForceSafeMode'><img src="https://img.shields.io/badge/-GitHub-3A3A3A?style=flat&amp;logo=GitHub&amp;logoColor=white" referrerpolicy="no-referrer" alt="GitHub"></a>
<a href='https://greasyfork.org/zh-CN/scripts/453648-pixiv-forcesafemode'><img src="https://img.shields.io/badge/-GreasyFork-670000?style=flat&amp;logo=tampermonkey&amp;logoColor=white" referrerpolicy="no-referrer" alt="GreasyFork"></a>
Expand All @@ -15,4 +15,10 @@ While writing the last Pixiv user script, I realized that the official (Safe/R-1

### PS

The button is on the top bar, you should be able to see it.
The button is on the top bar, you should be able to see it.
<!--
## Pixiv-ForceSafeMode `v1.3`
- Fixed concurrency bugs
- 修复了并发漏洞
- コンカレント・ホールを修正しました
-->
25 changes: 12 additions & 13 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @name:zh-CN Pixiv-一键强制和谐
// @name:ja Pixiv-ワンタッチセキュリティモード
// @namespace https://github.com/TitanRGB
// @version 1.2
// @version 1.3
// @description While writing the last Pixiv user script, I realized that the official (Safe/R-18) filter didn't cover all the scenes. So I made this script to filter all bad information with one click.
// @description:zh-CN 开发上一个 Pixiv 插件时,意识到官方的 (全年龄/R-18) 过滤器并不能覆盖所有场景,容易使我的身体吃不消。因此需要更强大的强制过滤插件来一键过滤所有不良信息。
// @description:ja 前回のPixivユーザースクリプトを作成している最中、公式の(セーフ/ R-18)フィルターがすべてのシーンをカバーしていないことに気づきました。 したがって、1つのクリックですべての不適切な情報をフィルタリングするより強力な強制フィルタリングスクリプトが必要です。
Expand Down Expand Up @@ -186,18 +186,17 @@ let main = function () {
let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
let observer = new MutationObserver(function (mutations) {
mutations.forEach(function () {
if (new Date().getTime() - last_run_time > 20) {
setTimeout(function () {
// 主函数-添加交互按钮
if (document.querySelectorAll('div[class="Pixiv-QuickSafeMode"]').length === 0) {
main();
delete_r18();
}
// 删除R-18
else {
delete_r18();
}
}, 100);
if (new Date().getTime() - last_run_time > 100) {
// 主函数-添加交互按钮
if (document.querySelectorAll('div[class="Pixiv-QuickSafeMode"]').length === 0) {
main();
delete_r18();
}
// 删除R-18
else {
delete_r18();
}
// console.log('Pixiv-QuickSafeMode: MutationObserver');
}
});
});
Expand Down

0 comments on commit 38fb8fe

Please sign in to comment.