jc3213 / download_with_aria2

The browser extenson for aria2 download utility via JSON-RPC
GNU Lesser General Public License v2.1
60 stars 8 forks source link

Settings aren't preserved on Firefox #68

Closed glu8716 closed 1 year ago

glu8716 commented 1 year ago

I'm using version 4.3.1.1994 on Firefox. Even if change settings, those aren't preserved when I close the settings page

jc3213 commented 1 year ago

You should press Save button in the mainmenu on the top to save your changes. Wiki:Options

glu8716 commented 1 year ago

That's what I do. It works if, for example, I refresh the page. But as soon as I close the tab the settings go back to the default ones

jc3213 commented 1 year ago

It works fine on my side. changes

Even I've downgraded to 4.3.1.1994 changes2

glu8716 commented 1 year ago

I've made a quick video to show my problem. Do you have any idea on what could possibly be causing this?

https://github.com/jc3213/download_with_aria2/assets/33501455/c6e313c5-ebd9-4d3c-a71a-652078877bd2

jc3213 commented 1 year ago

It seems you've got some Fatal Error when initializing Options. The most possible reason is Storage.keys not matching the options. Once you've installed the extension, if will write Default Settings into your browser storage via storage.local API

Have you updated from a very old version? The background storage have been changed about 3 or 4 times. The compaibility code have been removed after the next major update since the changes

For example, if storage changes occured in 4.1.3, then the compatibility code will be implemented in 4.1.3 then removed in 4.2.0

You can try remove the extension then install a new one from AMO

PS: I've reproduced your problem once randomly. I've removed the extension, then refresh Firefox Add-ons Manager page, and reinstall 4.3.1, then the toolbar badge icon won't appear and when I open Options it is not initialized as yours (all options are empty without default settings). But after removing and reinstalling, the problem has gone, and I can not reproduce that problem again.

glu8716 commented 1 year ago

I had a old version installed, but I uninstalled it before installing the new one. I've tried to uninstall and reinstall it again with no luck.

I've also tried in a Firefox clean profile and it seems to work fine there. There must be something wrong with this profile I'm using. I'm using the arkenfox user.js, could it be related to some Firefox setting?

jc3213 commented 1 year ago

You can open the console F12 and see if there are error messages. And then you can type aria2Store to see if the storage works for you

glu8716 commented 1 year ago

I get a TypeError: url is undefined error

jc3213 commented 1 year ago

Tell me the result of aria2Store and aria2RPC as below. BTW, there's no code on my side that causes TypeError aria2Store

aria2RPC

glu8716 commented 1 year ago

I can't see any output in the console as I get only that error 2023-06-10_11-58

jc3213 commented 1 year ago

Type aria2Store after >> and press Enter key, then aria2RPC and press Enter key

glu8716 commented 1 year ago

image Here's the result

jc3213 commented 1 year ago

It seems the storage haven't been initialized for you. I don't know what caused this. You'll need to install Firefox Developer Edition then debug the extension

You can try copy the code below, then paste them into the console, press Enter. Wait about 1~2 seconds to see if there's any error. If not, try to close, then open the Options again

browser.storage.local.set({
    'jsonrpc_uri': 'http://localhost:6800/jsonrpc',
    'jsonrpc_token': '',
    'manager_newtab': false,
    'manager_interval': 10000,
    'folder_enabled': false,
    'folder_defined': '',
    'download_prompt': false,
    'download_headers': true,
    'notify_start': false,
    'notify_complete': true,
    'user_agent': 'Transmission/4.0.0',
    'proxy_server': '',
    'proxy_enabled': false,
    'proxy_always': false,
    'proxy_include': [],
    'capture_enabled': false,
    'capture_always': false,
    'capture_filesize': 0,
    'capture_resolve': [],
    'capture_include': [],
    'capture_reject': [],
    'capture_exclude': [],
    'folder_firefox': false,
    'capture_webrequest': false
})
glu8716 commented 1 year ago

That worked, thanks! I can now save settings