diff --git a/Memory Usage Monitor/icons/icon128.png b/Memory Usage Monitor/icons/icon128.png new file mode 100644 index 00000000..066b3c70 Binary files /dev/null and b/Memory Usage Monitor/icons/icon128.png differ diff --git a/Memory Usage Monitor/icons/icon16.png b/Memory Usage Monitor/icons/icon16.png new file mode 100644 index 00000000..ca799bc3 Binary files /dev/null and b/Memory Usage Monitor/icons/icon16.png differ diff --git a/Memory Usage Monitor/icons/icon48.png b/Memory Usage Monitor/icons/icon48.png new file mode 100644 index 00000000..a8ff1bcf Binary files /dev/null and b/Memory Usage Monitor/icons/icon48.png differ diff --git a/Memory Usage Monitor/index.html b/Memory Usage Monitor/index.html new file mode 100644 index 00000000..51b992bb --- /dev/null +++ b/Memory Usage Monitor/index.html @@ -0,0 +1,29 @@ + + + + + + Memory Usage Monitor + + + +
+

Memory Usage Monitor

+
+
+ Total Memory: + Loading... +
+
+ Available Memory: + Loading... +
+
+ Used Memory: + Loading... +
+
+
+ + + diff --git a/Memory Usage Monitor/manifest.json b/Memory Usage Monitor/manifest.json new file mode 100644 index 00000000..5b935bff --- /dev/null +++ b/Memory Usage Monitor/manifest.json @@ -0,0 +1,18 @@ +{ + "manifest_version": 3, + "name": "Memory Usage Monitor", + "version": "1.0", + "description": "Monitor memory usage of your system", + "action": { + "default_popup": "index.html", + "default_icon": { + "16": "icons/icon16.png", + "48": "icons/icon48.png", + "128": "icons/icon128.png" + } + }, + "permissions": [ + "system.memory" + ] + } + \ No newline at end of file diff --git a/Memory Usage Monitor/script.js b/Memory Usage Monitor/script.js new file mode 100644 index 00000000..21039984 --- /dev/null +++ b/Memory Usage Monitor/script.js @@ -0,0 +1,22 @@ +document.addEventListener('DOMContentLoaded', () => { + const totalMemoryElement = document.getElementById('total-memory'); + const availableMemoryElement = document.getElementById('available-memory'); + const usedMemoryElement = document.getElementById('used-memory'); + + if (chrome.system && chrome.system.memory) { + chrome.system.memory.getInfo((info) => { + const totalMemory = (info.capacity / (1024 * 1024 * 1024)).toFixed(2); // Convert to GB + const availableMemory = (info.availableCapacity / (1024 * 1024 * 1024)).toFixed(2); // Convert to GB + const usedMemory = (totalMemory - availableMemory).toFixed(2); + + totalMemoryElement.textContent = `${totalMemory} GB`; + availableMemoryElement.textContent = `${availableMemory} GB`; + usedMemoryElement.textContent = `${usedMemory} GB`; + }); + } else { + totalMemoryElement.textContent = 'Not supported'; + availableMemoryElement.textContent = 'Not supported'; + usedMemoryElement.textContent = 'Not supported'; + } + }); + \ No newline at end of file diff --git a/Memory Usage Monitor/style.css b/Memory Usage Monitor/style.css new file mode 100644 index 00000000..51b11193 --- /dev/null +++ b/Memory Usage Monitor/style.css @@ -0,0 +1,45 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: #f0f0f0; + } + + .container { + background: #fff; + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + text-align: center; + } + + h1 { + margin-bottom: 20px; + font-size: 24px; + color: #333; + } + + .memory-info { + display: flex; + flex-direction: column; + align-items: center; + } + + .info-item { + margin-bottom: 10px; + font-size: 18px; + } + + .label { + font-weight: bold; + } + + .value { + margin-left: 10px; + color: #555; + } + \ No newline at end of file