CyberChef/src/web/index.js

73 lines
1.9 KiB
JavaScript
Raw Normal View History

2016-11-28 11:42:58 +01:00
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
// Styles
import "./stylesheets/index.js";
// Libs
import "arrive";
import "snackbarjs";
import "bootstrap-material-design/js/index";
import "bootstrap-colorpicker";
import moment from "moment-timezone";
import * as CanvasComponents from "../core/lib/CanvasComponents.mjs";
// CyberChef
import App from "./App.mjs";
2022-03-25 15:59:54 +01:00
import Categories from "../core/config/Categories.json" assert {type: "json"};
import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
2016-11-28 11:42:58 +01:00
/**
* Main function used to build the CyberChef web app.
*/
2017-04-13 19:31:26 +02:00
function main() {
2017-04-13 19:08:50 +02:00
const defaultFavourites = [
2016-11-28 11:42:58 +01:00
"To Base64",
"From Base64",
"To Hex",
"From Hex",
"To Hexdump",
"From Hexdump",
"URL Decode",
"Regular expression",
"Entropy",
"Fork",
"Magic"
2016-11-28 11:42:58 +01:00
];
2017-02-09 16:09:33 +01:00
2017-04-13 19:08:50 +02:00
const defaultOptions = {
updateUrl: true,
showHighlighter: true,
treatAsUtf8: true,
wordWrap: true,
showErrors: true,
errorTimeout: 4000,
attemptHighlight: true,
theme: "classic",
useMetaKey: false,
ioDisplayThreshold: 2048,
logLevel: "info",
autoMagic: true,
imagePreview: true,
syncTabs: true,
preserveCR: "entropy"
2016-11-28 11:42:58 +01:00
};
document.removeEventListener("DOMContentLoaded", main, false);
window.app = new App(Categories, OperationConfig, defaultFavourites, defaultOptions);
2016-11-28 11:42:58 +01:00
window.app.setup();
2017-04-13 19:31:26 +02:00
}
2016-11-28 11:42:58 +01:00
window.compileTime = moment.tz(COMPILE_TIME, "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf();
window.compileMessage = COMPILE_MSG;
2016-11-28 11:42:58 +01:00
// Make libs available to operation outputs
window.CanvasComponents = CanvasComponents;
2016-11-28 11:42:58 +01:00
document.addEventListener("DOMContentLoaded", main, false);