Skip to content

Commit

Permalink
CRITICAL UPDATE CHANGES - reconstructred recordmanager, removed elect…
Browse files Browse the repository at this point in the history
…ron dependency, implemented websocket communication between chrome extension and server in order recorder work properly, added module to pack chrome extension, refactoring, fixed bugs and added comments
  • Loading branch information
KR1470R committed Apr 18, 2023
1 parent 0e72451 commit 3c06148
Show file tree
Hide file tree
Showing 29 changed files with 1,676 additions and 2,456 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<img src="./assets/logo.png">
</div>

# UNDER DEVELOPMENT.

# Documentation Content
1. [What it does?][1]
2. [Requirements][2]
Expand Down
57 changes: 57 additions & 0 deletions build_crx.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const ChromeExtension = require("crx");
const crypto = require("node:crypto");
const path = require("node:path");
const fs = require("node:fs");

try {
const private_key_path = path.resolve(
__dirname,
"src",
"recorder",
"extension",
"key.pem"
);

const private_key = crypto.generateKeyPairSync("rsa", {
modulusLength: 2048,
privateKeyEncoding: {
type: "pkcs8",
format: "pem",
},
}).privateKey;

fs.writeFileSync(private_key_path, private_key);

const crx = new ChromeExtension({
codebase: "http://localhost:8000/recorder_extension.crx",
privateKey: fs.readFileSync(private_key_path),
});

const source_crx_path = path.resolve(
__dirname,
"src",
"recorder",
"extension/"
);
const output_crx_path = path.resolve(
__dirname,
"dist",
"recorder_extension",
"recorder.crx"
);

console.log(`packing extension from ${source_crx_path}...`);
crx
.load(source_crx_path)
.then((crx) => crx.pack())
.then((crxBuffer) => {
fs.writeFileSync(output_crx_path, crxBuffer);
})
.catch((err) => {
throw err;
});
} catch (err) {
console.log("Failed to pack recorder extension: ", err.message);
process.exit(1);
}
Loading

0 comments on commit 3c06148

Please sign in to comment.