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
199 stars 29 forks source link

How to downgrade to old version? #65

Closed TheFlanker closed 6 months ago

TheFlanker commented 6 months ago

New version is shit.

I lost all settings. I cant connect to local ip (router) via proxy. Interface is shit.

No words.

How i can downgrade to old last stable version? Firefox 120 Windows 10

erosman commented 6 months ago

You can go to: https://addons.mozilla.org/firefox/addon/foxyproxy-standard/versions/ Download an older version

Data is recoverable as explained in https://github.com/foxyproxy/browser-extension/issues/53#issuecomment-1848282804

TheFlanker commented 6 months ago

@erosman Before your answer I made an export from 8.2 Then installed old version 7.5.1 But cant import data, nothing happens... I think because the config format is different...

Is there a way to convert the config from 8.2 to 7.5.1?

erosman commented 6 months ago

Export from v8 is not compatible with v7.

Did you recover the data through the method mentioned above? If so, you can use that data to import into v7.

TheFlanker commented 6 months ago

@erosman no, recover saving file with zero data.

erosman commented 6 months ago

If the data is not large, you can remove the user/passwords and post it and I will try to manually convert it for you.

TheFlanker commented 6 months ago

@erosman data is 200+ strings with different logins/pwd.

I already converted it to old format. But got new problem with sorting imported data. Do you know syntax of "ID" for sorting?

For example 5 "ids" and it sorting good when import from 1 to 5.

miyap71702156063025
5fgzo91702156066817
sk1u471702156070364
dap4o1702156073909
fnlgnn1702156077379

Do you know mask/syntax how to generate this for good sorting? Or generate pls 250 "ids" for me please...

erosman commented 6 months ago

The sorting was done via "index" property in v7.

TheFlanker commented 6 months ago

@erosman How i can generate 250+ strings with this "index" for change it in .json file for import?

erosman commented 6 months ago

The following code generates the ID.

Math.random().toString(36).substring(7) + new Date().getTime()
TheFlanker commented 6 months ago

@erosman ty, but not working good... Sorting is still random...

TheFlanker commented 6 months ago

Give me pls solution how to import config with good sorting...

I'm trying add "fake" proxy list, after export it and replace "ids" to my old cfg and import - but it to dont work... Sorting is random...

erosman commented 6 months ago

The new preference export is already sorted. It is in an array and array is sorted.

When converting the array to an object, you need to take the array index and set is as object property "index" for the old format.

Here is a quick example... The include/exclude formats are different and it might not be possible to convert them back.

data is the data in the new format database.

const typeSet = {
  'http': 1,    // PROXY_TYPE_HTTP
  'https': 2,   // PROXY_TYPE_HTTPS
  'socks5': 3,  // PROXY_TYPE_SOCKS5
  'socks4': 4,  // PROXY_TYPE_SOCKS4
  'direct': 5   // PROXY_TYPE_NONE
};
let obj = {};

data.forEach((i, index) => {
  // generate an id
  const id = Math.random().toString(36).substring(7) + new Date().getTime();
  obj[id] = {
    index,
    active: i.active,
    title: i.title,
    color: i.color,
    type: typeSet[i.type],
    address: i.hostname,
    port: i.port*1,
    username: i.username,
    password: i.password,
    cc: i.cc,
    country: '',
    whitePatterns: i.include,
    blackPatterns: i.exclude,
    proxyDNS: false,
    pacURL: i.pac
  };
});
ohitworks commented 6 months ago

@erosman Thank you for your patient response to the question and your useful code. @TheFlanker I also need to roll back to version 7.5 because of bugs in the new version. Through this issue, I wrote this simple script to modify the configuration to the old format. I updated with the json config file exported by the new version, it seemed to maintain the order. Hope this helps. (link here)[https://github.com/ohitworks/FoxyProxy-Config-Rollback]