Skip to content

Commit f06ed73

Browse files
committed
Add Deobfuscation built into the editor
1 parent dc89a93 commit f06ed73

File tree

11 files changed

+1675
-23
lines changed

11 files changed

+1675
-23
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,11 @@ MIT. See `LICENSE.txt`.
6565

6666
- Docs page: `https://mrblankcoding.github.io/CodeTweak/guide/privacy`
6767
- Source page: `docs-src/guide/privacy.md`
68+
69+
## Credits
70+
71+
CodeTweak uses these open source projects:
72+
73+
- [webcrack](https://github.com/j4k0xb/webcrack) (MIT)
74+
- [Feather Icons](https://github.com/feathericons/feather) (MIT)
75+
- [CodeMirror](https://github.com/codemirror/dev) (MIT)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function throwFsUnavailable() {
2+
throw new Error('Node fs/promises is not available in the browser build');
3+
}
4+
5+
export async function mkdir() {
6+
throwFsUnavailable();
7+
}
8+
9+
export async function writeFile() {
10+
throwFsUnavailable();
11+
}
12+
13+
export async function readFile() {
14+
throwFsUnavailable();
15+
}
16+
17+
export async function rm() {
18+
throwFsUnavailable();
19+
}
20+
21+
export default {
22+
mkdir,
23+
writeFile,
24+
readFile,
25+
rm,
26+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export function readFileSync() {
2+
throw new Error('Node fs is not available in the browser build');
3+
}
4+
5+
export function existsSync() {
6+
return false;
7+
}
8+
9+
export default {
10+
readFileSync,
11+
existsSync,
12+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export class Isolate {
2+
constructor() {
3+
throw new Error('isolated-vm is not available in the browser build');
4+
}
5+
}
6+
7+
export default {
8+
Isolate,
9+
};

buildScripts/build.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,17 @@ await build({
5151
outdir,
5252
logLevel: 'info',
5353
platform: 'browser',
54+
alias: {
55+
path: 'path-browserify',
56+
'node:path': 'path-browserify',
57+
assert: 'assert',
58+
fs: join(process.cwd(), 'buildScripts/browser_stubs/fs_stub.js'),
59+
'node:fs/promises': join(process.cwd(), 'buildScripts/browser_stubs/fs_promises_stub.js'),
60+
'isolated-vm': join(process.cwd(), 'buildScripts/browser_stubs/isolated_vm_stub.js'),
61+
},
5462
define: {
63+
'process.env.NODE_ENV': JSON.stringify(isProduction ? 'production' : 'development'),
64+
'process.env.BABEL_TYPES_8_BREAKING': 'false',
5565
'process.env.BROWSER': JSON.stringify('chrome'),
5666
'process.env.BUILD_TARGET': JSON.stringify('chrome'),
5767
},

0 commit comments

Comments
 (0)