diff --git a/extensions/DevidBittFive/ramusage.js b/extensions/DevidBittFive/ramusage.js new file mode 100644 index 0000000000..50a4cea588 --- /dev/null +++ b/extensions/DevidBittFive/ramusage.js @@ -0,0 +1,72 @@ +// Name: RAM Monitor +// ID: bitterRamUsage +// Description: Monitors current RAM usage and percentage. +// By: DevidBittFive +// License: EPL-2.0 OR GPL-2.0-or-later + +/**! + * @license EPL-2.0 OR GPL-2.0-or-later + * All code contained in this extension is licensed under the Eclipse Public License v2.0. + * + * If you have not received a copy of this license, you may access it + * at the following link: https://www.eclipse.org/legal/epl-2.0/ + */ + +(function (Scratch) { + "use strict"; + + // Cache once outside the class + const mem = + globalThis.performance && globalThis.performance.memory + ? globalThis.performance.memory + : null; + + class RamUsageExtension { + getInfo() { + return { + id: "bitterRamUsage", + name: Scratch.translate("RAM Monitor"), + blocks: [ + { + blockType: Scratch.BlockType.XML, + xml: mem + ? "" + : ` + +