jc3213 / download_with_aria2

The browser extenson for aria2 download utility via JSON-RPC
https://jc3213.github.io/download_with_aria2/
GNU Lesser General Public License v2.1
65 stars 9 forks source link

Settings discarded/never saved #82

Closed NotMithical closed 8 months ago

NotMithical commented 8 months ago

I updated the extension today (v4.6.5.2366) and it immediately showed an error indicator. I checked the extensions settings and found that every field, most importantly those for the JSON-RPC hostname and secret, were blank. I re-entered the information and clicked save, but if I close close the tab and open the settings again everything I changed reverts to the default/empty settings.

jc3213 commented 8 months ago

Sorry about it. This may because the update patch is not working correctly, you can copy and paste the code below into the debug console (open Options and press F12), and press enter to run it. wait for 5 seconds and restart the extension, it will fix the problem

(function hotfix() {
    var uri = aria2Storage['jsonrpc_uri'];
    var secret = aria2Storage['jsonrpc_token'];
    var {protocol, host} = new URL(uri);
    var scheme = protocol.slice(0, -1);
    aria2Storage['jsonrpc_scheme'] = scheme;
    aria2Storage['jsonrpc_host'] = host;
    delete aria2Storage['jsonrpc_uri'];
    aria2Storage['jsonrpc_secret'] = secret;
    delete aria2Storage['jsonrpc_token'];
    chrome.storage.sync.set(aria2Storage);
    aria2RPC = new Aria2(scheme, host, secret);
})();
NotMithical commented 8 months ago

Thank you, that's fixed that issue, however now when I attempt to start a download a new prompt opens as if I clicked the new DL button. I assume this is unrelated, should I open a separate issue?

jc3213 commented 8 months ago

You should turn off Enable Download Prompt in options

NotMithical commented 8 months ago

That's taken care of it, thank you!