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

build: update seia-soto/asdefuser #69

Merged
merged 6 commits into from
Jan 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
build: update seia-soto/asdefuser
seia-soto/userscripts@bdfcad6

Co-authored-by: HoJeong Go <seia@outlook.kr>
  • Loading branch information
piquark6046 and seia-soto committed Jan 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d941c6deb4731ba7299c03270265827a89a95f8e
12 changes: 6 additions & 6 deletions microShield.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "microshield",
"version": "3.12.19",
"version": "3.13.0",
"description": "",
"type": "module",
"scripts": {
2 changes: 1 addition & 1 deletion sources/banner.txt
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
// @downloadURL https://cdn.jsdelivr.net/gh/List-KR/microShield@latest/microShield.user.js
// @license Apache-2.0
//
// @version 3.12.19
// @version 3.13.0
// @author PiQuark6046 and contributors
//
// @match *://algumon.com/*
17 changes: 6 additions & 11 deletions sources/src/call-validators/analyzers.ts
Original file line number Diff line number Diff line change
@@ -27,25 +27,20 @@ export const annoymousCallAnalyzer = new MemoizedCallAnalyzer(line => line.start

export const extensionCallAnalyzer = new MemoizedCallAnalyzer(line => line.startsWith('chrome') || line.startsWith('webkit') || line.startsWith('moz'));

const knownAdShieldOrigins = [
'https://07c225f3.online',
'https://css-load.com',
'https://html-load.com',
'https://content-loader.com',
'https://fb.content-loader.com',
export const knownAdShieldOrigins = [
'07c225f3.online',
'css-load.com',
'html-load.com',
'content-loader.com',
];

export const adShieldCallAnalyzer = new MemoizedCallAnalyzer(line => {
if (line.endsWith('/script.min.js') || line.endsWith('/loader.min.js')) {
return true;
}

if (!location.origin.endsWith('.online') && line.includes('.online')) {
return true;
}

for (const origin of knownAdShieldOrigins) {
if (line.startsWith(origin)) {
if (line.includes(origin)) {
return true;
}
}
29 changes: 29 additions & 0 deletions sources/src/index.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import {basedrop} from './loaders/basedrop.js';
import {tinywave} from './loaders/ztinywave.js';
import {documentReady, getCallStack, makeProxy, makeProxyError, makeUnsafeProxy} from './utils.js';
import {adShieldOriginCheck, adShieldStrictCheck} from './call-validators/suites.js';
import {adShieldCallAnalyzer, knownAdShieldOrigins} from './call-validators/analyzers.js';
import {isAdShieldObj} from './obj-validators/index.js';
import {isNotResourceInfectedByAdShield} from './call-validators/analyzers.js';

@@ -18,6 +19,20 @@ const bootstrap = () => {
win.Element.prototype.removeChild = makeUnsafeProxy(win.Element.prototype.removeChild, 'Element.prototype.removeChild');
win.Element.prototype.insertAdjacentHTML = makeProxy(win.Element.prototype.insertAdjacentHTML, 'Element.prototype.insertAdjacentHTML');
win.Element.prototype.setAttribute = makeProxy(win.Element.prototype.setAttribute, 'Element.prototype.setAttribute');
win.HTMLScriptElement.prototype.setAttribute = new Proxy(win.HTMLScriptElement.prototype.setAttribute, {
apply(target, thisArg, argArray: [string, string]) {
if (argArray[0] === 'src' && typeof argArray[1] === 'string') {
if (adShieldCallAnalyzer.analyze(argArray[1])) {
return;
}
}

Reflect.apply(target, thisArg, argArray);
},
setPrototypeOf(_target, _v) {
return false;
},
});
win.EventTarget.prototype.addEventListener = makeProxy(win.EventTarget.prototype.addEventListener, 'EventTarget.prototype.addEventListener');
win.Function.prototype.apply = makeProxy(win.Function.prototype.apply, 'Function.prototype.apply');
// Prevent messaging to inline
@@ -27,6 +42,20 @@ const bootstrap = () => {
win.setInterval = makeProxy(win.setInterval, 'setInterval');
win.setTimeout = makeProxy(win.setTimeout, 'setInterval');

win.decodeURIComponent = new Proxy(win.decodeURIComponent, {
apply(target, thisArg, argArray: [string]) {
const payload = Reflect.apply(target, thisArg, argArray);

for (const domain of knownAdShieldOrigins) {
if (payload.includes(domain)) {
return '';
}
}

return payload;
},
});

// Local Storage
localStorage.removeItem('as_profile_cache');
localStorage.removeItem('adshield-analytics-uuid');