Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popup: display how much storage the clipboard history list is using #19

Open
ayoung19 opened this issue Sep 26, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ayoung19
Copy link
Owner

ayoung19 commented Sep 26, 2024

https://developer.chrome.com/docs/extensions/reference/api/storage#type-StorageArea

onChanged and getBytesInUse will be helpful here.

UI Ideas:
Add it to the main page like Copy History + does:
image

Add it in an "About" tab in the Settings modal. Could even add version history to this as well.

@ayoung19 ayoung19 added enhancement New feature or request good first issue Good for newcomers labels Sep 26, 2024
@ayoung19 ayoung19 changed the title popup: display how much storage the clipboard history list takes popup: display how much storage the clipboard history list is using Sep 26, 2024
@aanand3
Copy link
Contributor

aanand3 commented Jan 7, 2025

Did some initial digging on this one, one issue I'm seeing is that browser.storage.local.getBytesInUse isn't supported for Firefox.

For Chrome, it's doable via the way you mentioned, but do we want to introduce browser-specific functionality?

Another (janky?) option would be something that uses Plasmo's storage object:

async function getStorageUsage() {
  const allData = await storage.getAll();
  return new Blob([JSON.stringify(allData)]).size;
}

but not sure we want that running all the time. Keeping it in the Storage tab might be the best way to go to keep the compute load down... lmk your thoughts @ayoung19 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants