How to test Deep Links in Development mode

Hey,
I was trying to develop a deep link but while testing it always open my Main Joplin app, How should I check if it is working or not in the development mode.

I'm not certain you can since the app needs to register a handler, but the dev app doesn't do it. Perhaps @roman_r_m can confirm this.

1 Like

Yes, as far as I'm aware you can't use them in the dev mode.

1 Like

Thanks for your response.

I was trying to make a deep link to install the plugin directly from the browser.

I am facing some errors. The first 1-2 times I use the deep link it works as expected and installs the plugin.

ex:-
joplin://x-callback-url/installPlugin?id=io.github.jackgruber.backup

but after some time it somehow throws an error that runtime is not found

Logs:-
I tried to install 6 plugins 4 got installed, 1 gave an error that its already installed, and the last one give the runtime error
joplin.log (28.3 KB)

Well it looks like the link is working, otherwise there would be no error.

I don't know what's causing this, maybe something is not being initalised by the time it tries to handle the link.

Where do you register the installPlugin command? You should probably do it at app level to ensure it's always active.

If you register it at MainScreen level for example it won't be active if the config screen is open.

Yes, I register the cmd in the MainScreen level which causes the problem, making it app-level fixed the error.
Thanks

Well, if callback URLs cannot be used in dev mode, how should I test them out?
Will my main Joplin instance data be wiped out if I change it to prod or something?

UPD: it's using my main instance profile - probably bad because it might cause problems to main instance code who does not expect the DB to be upgraded by latest commits on dev branch.

Anyway, what helped is calling app like this while one instance is already running (removed dev mode flags from the npm start command in package.json).

C:\Users\user\Programs\NodeJS\npm.cmd start "joplin://x-callback-url/openNote?id=b0a6a573f6fd4b54866009ccdf113d55"

It basically imitates what the browser does under the hood.

Why it's important that it's not dev mode - because dev mode would spawn another instance even though I commented out this line at ElectronAppWrapper.ts

if (this.env_ === 'dev') return false;