devspy-tool 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +56 -0
- package/config.js +6 -0
- package/dist/assets/index-BPZbQMS8.js +12 -0
- package/dist/assets/index-BeP94nNh.css +1 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/index.html +24 -0
- package/package.json +36 -0
- package/puppeteer/debug.js +82 -0
- package/puppeteer/explorer.js +507 -0
- package/puppeteer/interceptor.js +622 -0
- package/puppeteer/launcher.js +30 -0
- package/puppeteer/network.js +253 -0
- package/puppeteer/sessionStore.js +140 -0
- package/routes/scan.js +334 -0
- package/server.js +44 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const { exec } = require("child_process");
|
|
6
|
+
|
|
7
|
+
function getChromePath() {
|
|
8
|
+
const platform = os.platform();
|
|
9
|
+
if (platform === "darwin") {
|
|
10
|
+
return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
|
|
11
|
+
} else if (platform === "win32") {
|
|
12
|
+
// Fallback for Windows
|
|
13
|
+
return "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
|
|
14
|
+
} else if (platform === "linux") {
|
|
15
|
+
return "/usr/bin/google-chrome";
|
|
16
|
+
}
|
|
17
|
+
return "";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Auto-detect Chrome if not provided
|
|
21
|
+
if (!process.env.CHROME_PATH) {
|
|
22
|
+
process.env.CHROME_PATH = getChromePath();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Default port for CLI
|
|
26
|
+
process.env.PORT = process.env.PORT || 5001;
|
|
27
|
+
|
|
28
|
+
console.log("[DevSpy] Starting local server...");
|
|
29
|
+
|
|
30
|
+
// Load the server
|
|
31
|
+
require(path.join(__dirname, "../server.js"));
|
|
32
|
+
|
|
33
|
+
// Auto-open browser after a short delay
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
const url = `http://localhost:${process.env.PORT}`;
|
|
36
|
+
console.log(`[DevSpy] Opening browser at ${url}`);
|
|
37
|
+
|
|
38
|
+
let command = "";
|
|
39
|
+
switch (process.platform) {
|
|
40
|
+
case "darwin":
|
|
41
|
+
command = `open ${url}`;
|
|
42
|
+
break;
|
|
43
|
+
case "win32":
|
|
44
|
+
command = `start ${url}`;
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
command = `xdg-open ${url}`;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
exec(command, (err) => {
|
|
52
|
+
if (err) {
|
|
53
|
+
console.warn(`[DevSpy] Could not auto-open browser. Please manually navigate to: ${url}`);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}, 1000);
|
package/config.js
ADDED