foxyproxy / browser-extension

Version 8 and above. Browser extension source code for Firefox, Chrome, and other Chromium-based browsers
GNU General Public License v2.0
198 stars 29 forks source link

Feature Request: bulk delete #137

Open ericjung opened 2 weeks ago

ericjung commented 2 weeks ago

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 commented 2 weeks ago

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());
})();
ericjung commented 1 week ago

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 commented 1 week ago

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. :thinking: