Skip to content

Commit

Permalink
chore: update bypass class
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumm1t committed Nov 21, 2020
1 parent 0d92c1c commit 7448e2c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 14 deletions.
12 changes: 7 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Anti Testportal",
"description": "Bypass for blur check on testportal.pl",
"version": "4.0.0",
"version": "4.0.1",
"manifest_version": 2,
"content_scripts": [
{
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anti-testportal",
"version": "4.0.0",
"version": "4.0.1",
"description": "Bypass for blur check on testportal.pl(net)",
"scripts": {
"build:dev": "webpack --config=webpack.dev.conf.js",
Expand Down
18 changes: 17 additions & 1 deletion src/bypass.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
declare const Lumm1t: undefined;

export default class Bypass {
public createBypass (): void {
constructor () {
try {
this.getFunctions();
} catch (err) {
console.error(err);
return;
}
}

public getFunctions (): string {
const antiBlur = this.antiBlur.toString();
const bypassFunction = antiBlur.slice(antiBlur.indexOf('{') + 1, antiBlur.lastIndexOf('}'));

return bypassFunction;
}

private antiBlur (): void {
// Remove ability to read focus value.
Object.defineProperty(document, 'hasFocus', {
get: (): ReferenceError => Lumm1t
Expand Down
5 changes: 1 addition & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ class Main {
}

private createScript (): void {
const bypassFunction = this.bypass.createBypass.toString();
const bypass = bypassFunction.slice(bypassFunction.indexOf('{') + 1, bypassFunction.lastIndexOf('}'));

const script = document.createElement('script') as HTMLScriptElement;

script.setAttribute('type', 'text/javascript');
script.innerHTML = bypass;
script.innerHTML = this.bypass.getFunctions();

document.body.appendChild<HTMLScriptElement>(script);
}
Expand Down

0 comments on commit 7448e2c

Please sign in to comment.