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

Feature Request: bulk delete #137

Open
ericjung opened this issue Jun 18, 2024 · 3 comments
Open

Feature Request: bulk delete #137

ericjung opened this issue Jun 18, 2024 · 3 comments
Labels
snippet Code snippet

Comments

@ericjung
Copy link
Contributor

ericjung commented Jun 18, 2024

Suggestion from a user: ability to select and delete multiple proxy settings at once. Current solution is very tedious for many proxy settings. Older versions of FoxyProxy had this capability; see screenshot and look for "Delete Selection" button

photo-size-1-59931742

The current UI has no way to select/unselect rows, so this may be challenging.

@erosman
Copy link
Collaborator

erosman commented Jun 18, 2024

For now, the following script snippet can be used to bulk delete proxies.

(() => {
  // ----- bulk delete
  // user settings
  // example: const list = [1, 2, 4];
  const list = [];                                                 
  // end of user settings

  document.querySelectorAll('details.proxy').forEach((i, n) => list.includes(n + 1) && i.remove());
})();

@erosman erosman added the snippet Code snippet label Jun 18, 2024
@ericjung
Copy link
Contributor Author

ericjung commented Jun 24, 2024

For now, the following script snippet can be used to bulk delete proxies.

(() => {
  // ----- bulk delete
  // user settings
  // example: const list = [1, 2, 4];
  const list = [];                                                 
  // end of user settings

  document.querySelectorAll('details.proxy').forEach((i, n) => list.includes(n + 1) && i.remove());
})();

To delete all (assumes no more than 10,000 proxies are defined):

  (() => {
  const list = [...Array(10001).keys()];
  document.querySelectorAll('details.proxy').forEach((i, n) => list.includes(n + 1) && i.remove());
  })()

@erosman
Copy link
Collaborator

erosman commented Jun 24, 2024

To delete all proxies ...

document.querySelectorAll('details.proxy').forEach(i => i.remove());

PS. If Bulk Edit operations becomes popular, I can define some globals to make it easier. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snippet Code snippet
Projects
None yet
Development

No branches or pull requests

2 participants