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: easily move pattern from one proxy to the other #131

Open nvalexander opened 3 months ago

nvalexander commented 3 months ago

I think that it would be great if a dropdown would be added to each pattern row, allowing uses to move them to a different proxy. Its place should at the end of the row. To make room for this dropdown, the Quick Add dropdown could be removed from the start of the column. As is, chosing something from the QuickAdd dropdown overwrites your well-thought pattern, without confirmation and with a counterintuitive ways to undo the change.

erosman commented 3 months ago

I think that it would be great if a dropdown would be added to each pattern row, allowing uses to move them to a different proxy. Its place should at the end of the row.

Let's see if there is a popular demand for such a feature. There is a pattern import/export feature but that applies to all patterns under a proxy.

something from the QuickAdd dropdown overwrites your well-thought pattern, without confirmation and with a counterintuitive ways to undo the change.

Confirmation can be annoying, if every action results in a modal popup asking "Are you sure you want to do that?", which then has to be clicked to continue.

Editing & importing are non-destructive. Save must be clicked to apply changes.

erosman commented 3 months ago

For now, the following script can be used to move a pattern from one proxy to another.

(() => {
  // ----- move pattern from one proxy to another
  // user settings
  const fromProxy = 1;                                      // move from the 1st proxy
  const patternIndex = 1;                                   // move the 1st pattern
  const toProxy = 3;                                        // move to the 3rd proxy
  // end of user settings

  const pattern = document.querySelector(`details.proxy:nth-of-type(${fromProxy}) .pattern-row:nth-of-type(${patternIndex})`);
  if (!pattern) { return; }

  const target = document.querySelector(`details.proxy:nth-of-type(${toProxy}) .pattern-box`);
  if (!target) { return; }

  target.appendChild(pattern);
})();
nvalexander commented 2 months ago

I am not terribly pressed by the number of patterns that need to be moved. I just find it counterintuitive to have tens of dropboxes that, at best, are useless, and in the worst case scenario may be destructive, by overwriting a pattern that I already picked.