mirror of
https://github.com/gchq/CyberChef
synced 2025-12-10 05:13:23 +00:00
The raw, unpresented dish is now returned to the app after baking, where it can be retrieved as various different data types.
This commit is contained in:
@@ -60,6 +60,9 @@ self.addEventListener("message", function(e) {
|
||||
case "silentBake":
|
||||
silentBake(r.data);
|
||||
break;
|
||||
case "getDishAs":
|
||||
getDishAs(r.data);
|
||||
break;
|
||||
case "docURL":
|
||||
// Used to set the URL of the current document so that scripts can be
|
||||
// imported into an inline worker.
|
||||
@@ -125,6 +128,22 @@ function silentBake(data) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Translates the dish to a given type.
|
||||
*/
|
||||
async function getDishAs(data) {
|
||||
const value = await self.chef.getDishAs(data.dish, data.type);
|
||||
|
||||
self.postMessage({
|
||||
action: "dishReturned",
|
||||
data: {
|
||||
value: value,
|
||||
id: data.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks that all required modules are loaded and loads them if not.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user