How to start webclipper headless?

I implemented a python interface for Joplins data API, since the other python API is not maintained anymore. I would like to run automated tests without any user interactions. The only way I found to start webclipper looks as follows:

  1. Download joplin
  2. Start joplin in virtual framebuffer
  3. Navigate to the webclipper button via pyautogui and selenium
  4. Click the button and copy the token
  5. Access the API

This is cumbersome. Is there are more convenient way?

Note: I did read Clipper authorisation mechanism | Joplin, but there is still user interaction required.

Edit: The test OS is Ubuntu 20.04 and using currently Joplin 2.4.9 from AppImage.

I think in theory you could write directly to Joplin's sqlite database as if webclipper has been enabled.
However this is obviously unsupported and prone to break sooner or later.

If you still would like to try, something like this may work:

  1. Create an empty Joplin profile and dump the settings table.
  2. Set up webclipper (can be done from the desktop app) and dump settings again.
  3. Diff and see which settings are needed to enable webclipper.
  4. Now in your tests you can write these settings directly to the database (when Joplin is stopped)

Use joplin npm package, use cli version to control the startup of joplin and open web clipper service, it will be fully automated

@rxliuli: My idea was to use as less dependencies as possible. So installing npm is not an option in this case.
@roman_r_m: The database itself doesn't contain the setting. However, there is settings.json that contains a parameter clipperServer.autoStart. Setting this variable works :slight_smile:

Thank you both for the help!

Do you know if it would be difficult to add a command line argument (something like --autostart-webclipper) for convenience?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.