Skip to content

Commit de28b2e

Browse files
committed
deprecating embedded chrome
1 parent 554d245 commit de28b2e

File tree

2 files changed

+19
-35
lines changed

2 files changed

+19
-35
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,25 @@
1414

1515
### Development Environment
1616

17-
Run *Posta* in a full development environment with a dedicated browser (Chromium):
17+
Run *Posta* in development environment:
1818

1919
1. Install *Posta*
2020
```bash
2121
git clone https://github.com/benso-io/posta
2222
cd posta
2323
npm install
2424
```
25-
1. Launch the dedicated Chromium session using the following command:
26-
```bash
27-
node posta <URL>
28-
```
29-
1. Click on the Posta extension to navigate to the UI
25+
2. start devlopment enviroment
26+
```bash
27+
npm start
28+
```
3029

3130
Dev mode includes a local web server that serves a small testing site and the exploit page.
3231
When running in dev mode, you can access the exploit page at http://localhost:8080/exploit/
3332

33+
The development environment will rebuild the extension when source code changes. To work on UI, start the development env, make your changes and refresh. Please note that changes to the background page are rebuilt, but will only take effect after the extension restarts (from browser menu)
34+
35+
3436

3537
### Chrome Extension
3638

posta.js

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
1-
const { spawn } = require("child_process");
2-
const chromium = require('chromium');
3-
const imagePath = chromium.path;
41
const appFactory = require("./tools/app-factory");
5-
6-
const startBrowser = (url) => {
7-
return new Promise((resolve, reject) => {
8-
let args = [
9-
`--user-data-dir=.local-files/browser-profile`,
10-
`--load-extension=${__dirname}/chrome-extension`,
11-
`--whitelisted-extension-id=dnhcogbojmopnpcnbbpicobacfacdbbk`,
12-
url
13-
].filter(a => a);
14-
const browserProcess = spawn(
15-
imagePath,
16-
args,
17-
{cwd:__dirname}
18-
);
19-
setTimeout(() => resolve(browserProcess), 1000)
20-
});
21-
}
22-
23-
const [nodeImage, scriptPath, url="http://127.0.0.1:8080/"] = process.argv;
24-
25-
if (true){
26-
appFactory(true);
27-
require("./tools/test-site/test-site-server")
28-
}
29-
30-
startBrowser(url);
2+
const express = require('express');
3+
const port = 8080;
4+
const {join} = require("path");
5+
const app = express();
6+
app.use("/", express.static(join(__dirname,'chrome-extension'),{index:"test-site.html"}));
7+
app.use("/exploit", express.static(join(__dirname,'chrome-extension'),{index:"exploit.html"}));
8+
appFactory(true);
9+
10+
app.listen(port, function () {
11+
console.log('development server running on ' + port);
12+
})

0 commit comments

Comments
 (0)