seansfkelley / nas-download-manager Goto Github PK
View Code? Open in Web Editor NEWAn open source browser extension for adding/managing download tasks to your Synology DiskStation.
An open source browser extension for adding/managing download tasks to your Synology DiskStation.
This is because adding a task via the background script doesn't re-poll after the add goes through (which it does when you add through the popup).
Rather than what it does now, which is kick you over to the settings page (to change your settings, but meh).
It could be grayed out, or perhaps get a badge with !
or similar on it.
Right now it just says "sorry, doesn't work". The way to fix this is to rewrite the communication layer between the popup and the background page to use sendMessage
instead of sharing references to JS objects, but that's a bunch of work.
If you leave the extension logged in but the NAS goes to sleep, it seems to "invalidate" the session in a sense by throwing back "no permissions" errors for many/all requests. Some API calls are wrapped to help prevent this by re-logging-in, but not all.
PathSelector
makes API calls that are unguarded by the "no permissions" check.
I'm thinking either:
apiActions
where they can be controlled.crowdin.com? The build tasks should probably also be streamlined, notably by including aliases and merging the typescript compilation into the rollup task, if possible.
see log below
E:\synology-download-manager> npm run zip
> [email protected] zip E:\synology-download-manager
> rimraf addon.zip && zip -r addon.zip . -i 'dist/*' -i 'html/*' -i 'icons/*' -i 'vendor/*' -i 'manifest.json' -x '**/*.map' -x '**/.DS_Store'
'zip' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.16237
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "zip"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] zip: `rimraf addon.zip && zip -r addon.zip . -i 'dist/*' -i 'html/*' -i 'icons/*' -i 'vendor/*' -i 'manifest.json' -x '**/*.map' -x '**/.DS_Store'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] zip script 'rimraf addon.zip && zip -r addon.zip . -i 'dist/*' -i 'html/*' -i 'icons/*' -i 'vendor/*' -i 'manifest.json' -x '**/*.map' -x '**/.DS_Store''.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the synology-download-manager package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! rimraf addon.zip && zip -r addon.zip . -i 'dist/*' -i 'html/*' -i 'icons/*' -i 'vendor/*' -i 'manifest.json' -x '**/*.map' -x '**/.DS_Store'
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs synology-download-manager
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls synology-download-manager
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\synology-download-manager\npm-debug.log
@types/chrome
is the Chrome implementation that WebExtensions is heavily based on. WebExtensions/Firefox have some changes, namely around Promises v. callbacks.
OS: Xubuntu 16.04
Browser and version: FF57 (was also in 56)
DSM version: DSM 5.2-5967 Update 6 (was also with Update 5)
Download Station version: 3.5-2985
It seems to be a very general issue, but since no one reported it so far, I guess I'm doing something wrong...
Hi, now we can only delete one download every time, must be a way of delete all on any place in the menu
http://prntscr.com/g40xq
http://prntscr.com/g40xv8
Thanks a lot
Use the dn
parameter to figure out what it should be called: https://en.wikipedia.org/wiki/Magnet_URI_scheme#Parameters
Extension version: 0.30 or 0.31, last updated 2017-11-15
Browser and version: Firefox 56.0 (64 bit)
DSM version: 4.2-3256
Download Station version: 3.3-2386
It just stop working some days ago,
today i open the settings page and click the "Test Connection" button,
then it shows "The requested version does not support this functionality."
Please bring back support for old DSM in future versions, thank you.
This will also mean we don't have to lock all the settings behind a credentials test.
Things to be aware of:
As reported from addon reviews. Haven't attempted a repro yet.
So left-clicking on e.g. magnet
links would automatically download them instead of having to right-click > Download with...
Could change the "filter" button to be generic "controls" button and then add a "Task Control" section to it that includes these buttons along with the clear button. Alternately, could also remove the always-visible text from the updating status and make it on-hover only to clear up space in the header bar.
Likely rollup/rollup#610.
The whole text box should probably be rethought anyway. It's pretty clunky.
If the NAS is asleep, the default 10 second timeout can be too short to allow it to wake and respond to requests. The symptom of this is a "connection failure" caused by a timeout even when the protocol, hostname and port are correct (and trying again works as expected).
Types that DownloadStation supports:
.torrent
and magnet:
(as long as the .torrent
file is downloadable by the current user and doesn't need to be downloaded by the DiskStation itself)In version 0.9.x and before, two-factor authentication accidentally worked in some extension/browser/DSM combinations due to the way cookies behave. I was forced to close out that accidental feature when DSM 6.2.4/7.0 made an unannounced breaking change causing the extension to start logging people out of their non-extension login sessions.
As a workaround, since the extension doesn't interact with any DSM session you might have outside the extension (i.e. in a browser tab), you can create a separate user with very few permissions but no second factor for use only with this extension. Alternately, you can downgrade to 0.9.3.
This may interact really poorly with the existing auto-relogin behavior, because sessions sometimes expire at weird times, but we can't store the second factor (by design) to log back in.
As a stop-gap for all the people asking for this, maybe I could introduce a "share login with browser" checkbox which disables the login behavior in the extension and asks people to login with a browser tab, thereby getting 2FA via a side channel again.
Maybe a little (?) next to the text or instead of the icon? Something so that when things fail, users are helped along to the explanation, which may be correctable by them.
If you were sent here by a message in the connection test area of the settings page, it means you're using an older version of DSM. These versions (4.x and possibly also 5.x) had a bug in the login code where they might override your existing browser session logged into DSM, if any, and replace it with the session logged in from the extension.
You can see if you're affected by this issue using the follow steps:
You can work around this issue by doing any of the following:
*.synology.me
domains Synology hands out).The issue is a bug in DSM where early versions of the login API would always return a Set-Cookie
header, even if you didn't ask for it (Synology Download Manager asks for a token that is passed around in Javascript instead, never using cookies, so that you can maintain a separate session in the extension). If third-party cookies are accepted, Firefox will respect the header and override the login cookie on the domain*, thereby replacing your browser session with the one from the extension.
This is a known issue on Synology's end, and their technical support's recommended fix was "use a newer version". Early versions of DSM do not have a version of the login API without this bug, which is why you had a message direct you here. Synology Download Manager will automatically use a newer, fixed version of the login API if it exists.
* Allowing cookies to leak out of extensions without user consent is arguably a bug, though I don't see anything on bugzilla.
If the extension is logging into a different user than normally used for your browser DSM sessions, the extension always highjacks the cookie so have to log out of the extension user and back into the normal browser user.
Example:
Hi
Edit: I'm having this issue on Firefox Nightly only! Works perfectly in Firefox and Chrome.
Thanks for this new addon which hopefully manages to seal the gap between Firefox and DSM Download Station once and for all ๐
After installing and setting the connection details, the connection test works successfully.
But, when I then click the toolbar button to show the list, I see "Error loading tasks".
Checking in the debug console, I see this:
(poll-1) polling for tasks... popup.js:64258:5
(poll-1) poll completed with response Object { type: "probable-wrong-url-or-no-connection", error: Error } popup.js:64269:9
Here the object in the debug console:
Does the CSRF token header have something to do with it?
I don't understand why the connection test is successful but then fails to make a request for the entries.
while executing npm run build
, it fails with the following log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 silly lifecycle [email protected]~prebuild: no script for prebuild, continuing
7 info lifecycle [email protected]~build: [email protected]
8 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~build: PATH: {....}
11 silly lifecycle [email protected]~build: Args: [ '/d /s /c',
11 silly lifecycle '(rm -r lib dist || true) && npm run build:transpile && npm run build:bundle && npm run build:styles' ]
12 silly lifecycle [email protected]~build: Returned: code: 1 signal: null
13 info lifecycle [email protected]~build: Failed to exec build script
14 verbose stack Error: [email protected] build: `(rm -r lib dist || true) && npm run build:transpile && npm run build:bundle && npm run build:styles`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd E:\synology-download-manager
17 error Windows_NT 10.0.16237
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
19 error node v6.10.2
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error [email protected] build: `(rm -r lib dist || true) && npm run build:transpile && npm run build:bundle && npm run build:styles`
22 error Exit status 1
23 error Failed at the [email protected] build script '(rm -r lib dist || true) && npm run build:transpile && npm run build:bundle && npm run build:styles'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the synology-download-manager package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error (rm -r lib dist || true) && npm run build:transpile && npm run build:bundle && npm run build:styles
23 error You can get information on how to open an issue for this project with:
23 error npm bugs synology-download-manager
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls synology-download-manager
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
This would pop up a UI similar to that of the current add button in the popup, but in the current tab (since, AFAICT, you can't programmatically open the popup itself).
Should there be a pair of displays, one each for hidden/visible, or just one global always?
Having trouble reproducing this, but what I do know is:
Hi!
Great extension, the update to FF57 brought me here. Your Extension has many more cool features than the others I have used but I miss one thing, which i cannot find here as a feature request.
When there is a download with no Download Link which is accessible with right click, such as a download started through a script the browser opens a dialouge-Box what to do with the file. Here would be great to have the option "Download with synology download Manager".
Thanks in advance.
Hi,
Does anyone have the issue that the plugin doesn't download torrents files?
It gives the error "Broken link", while the " Synology Download Station" plugin in Chrome works fine with the same torrent file?
Thank you.
If the NAS is asleep when the connection test starts, it will have to wait until it wakes from sleep. Maybe if the test takes more than N seconds the message should update to say as much?
The feature that when you click on a magnet link, Firefox automatically opens it with the extension "Synology Download Manager".
I have been using this feature in SynoLoader for a time. You set "extensions.SynoLoader.use_magnet; true" in about: config and after that, each magnet you click on opens automatically by the extension, awesome.
I think this code has something to do with that:
https://github.com/Lemutar/Synoloader/blob/master/src/modules/MagnetHandler.js
Logical things to support (asc/desc for all types):
This is probably something that should be readily accessible, so we'll want to include it in the header and probably redesign the header to fit it. We'll probably also want to put the filter checkboxes there too...?
Is the token invalidated into some weird state, or does it continue to work?
If you have e.g. a self-signed cert you haven't accepted on your system/browser, the extension's connection will fail, but it will fail with the "wrong hostname/port" message, which is misleading.
Could you please add the ability to specify the folder for saving files (when adding a task)?
Thank you! The extension is very good.
The quickconnect protocol is not officially documented and would require some reverse-engineering, so this feature is unlikely to get implemented any time soon.
The workaround for now is to use the regular "external access" configuration (e.g., the synology.me domain).
This is a problem with other addons as well. Wondering if there's a way to ask the browser to programmatically close the popup...?
The extension never displayed anything, except for the download count in the icon. However, now it shows this error:
p.s. after submiting this bug report, I saw the interface as intended for the first time :)
That probably means the bug is solved, but I'm still reporting just in case...
Extension version: 0.4.0
Browser and version: Firefox Developer edition 58.0b4
DSM version: 5.2
Download Station version: 3.5-2985
TypeError: 'n.toFixed is not a function'
Error stack trace: renderString@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:32820:23
formatMetric1024@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:32825:20
renderStatus@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:32893:20
render@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:32868:65
finishClassComponent@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:14329:22
updateClassComponent@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:14306:12
beginWork@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:14685:16
performUnitOfWork@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:16653:16
workLoop@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:16762:28
callCallback@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:5379:9
invokeGuardedCallbackDev@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:5418:7
invokeGuardedCallback@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:5275:5
performWork@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:16880:7
scheduleUpdateImpl@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:17265:19
scheduleUpdate@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:17204:12
scheduleTopLevelUpdate@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:17475:5
updateContainer@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:17505:7
renderSubtreeIntoContainer/<@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:21185:7
unbatchedUpdates@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:17336:14
renderSubtreeIntoContainer@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:21184:5
render@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:21209:12
@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:33285:13
fetchStateAndNotify/</<@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:31619:32
fetchStateAndNotify/<@moz-extension://35eac94a-192b-fe44-bac3-3b247322dea5/dist/js/popup.js:31619:9
React stack trace:
in Task$1 (created by Popup)
in ul (created by Popup)
in div (created by Popup)
in div (created by Popup)
in div (created by Popup)
in Popup
in FatalErrorWrapper
The issue is that getBackgroundPage
returns null
in private browsing mode, so the whole popup just dies.
Fixes include:
sendMessage
to talk to the background page (ugh).Kind of weird that the popup gets caught out by this, since there should only really be one popup per browser instance, private or no...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.