<h1id="joplin-web-clipper">Joplin Web Clipper</h1>
<p>The Web Clipper is a browser extension that allows you to save web pages and screenshots from your browser. To start using it, open the Joplin desktop application, go to the <strong>Web Clipper Options</strong> and follow the instructions.</p>
<p>The web clipper extension and the Joplin application communicates via a service, which is started by the Joplin desktop app.</p>
<p>However certain things can interfer with this service and prevent it from being accessible or from starting. If something does not work, check the following:</p>
<li>Check that the service is started. You can check this in the Web clipper options in the desktop app.</li>
<li>Check that the port used by the service is not blocked by a firewall. You can find the port number in the Web clipper options in the desktop Joplin application.</li>
<li>Check that no proxy is running on the machine, or make sure that the requests from the web clipper service are filtered and allowed. For example <ahref="https://github.com/laurent22/joplin/issues/561#issuecomment-392220191">https://github.com/laurent22/joplin/issues/561#issuecomment-392220191</a></li>
<p>If none of this work, please report it on the <ahref="https://discourse.joplin.cozic.net/">forum</a> or <ahref="https://github.com/laurent22/joplin/issues">GitHub issue tracker</a></p>
<li>Open <ahref="about:debugging">about:debugging</a> in Firefox.</li>
<li>Make sure the checkox "Enable add-on debugging" is ticked.</li>
<li>Scroll down to the Joplin Web Clipper extension.</li>
<li>Click on "Debugging" - that should open a new console window.</li>
</ul>
<p>Also press F12 to open the regular Firefox console (some messages from the Joplin extension can go there too).</p>
<p>Now use the extension as normal and replicate the bug you're having.</p>
<p>Copy and paste the content of both the debugging window and the Firefox console, and post it to the <ahref="https://discourse.joplin.cozic.net/">forum</a>.</p>
<h1id="using-the-web-clipper-service">Using the Web Clipper service</h1>
<p>The Web Clipper service can be used to create notes from any other application. It exposes a <ahref="https://en.wikipedia.org/wiki/Representational_state_transfer">REST API</a> with a number of methods to list folders and to create notes or attach images.</p>
<p>In order to use it, you'll first need to find on which port the service is running. To do so, open the Web Clipper Option in Joplin and if the service is running it should tell you on which port. Normally it runs on port <strong>41184</strong>. If you want to find it programmatically, you may follow this kind of algorithm:</p>
<pre><codeclass="lang-javascript">let port = null;
for (let portToTest = 41184; portToTest <= 41194; portToTest++) {
const result = pingPort(portToTest); // Call GET /ping
if (result == 'JoplinClipperServer') {
port = portToTest; // Found the port
break;
}
}
</code></pre>
<p>The following methods are available:</p>
<h3id="get-ping">GET /ping</h3>
<p>Tells whether the service is active or not. It should return "JoplinClipperServer" if it works.</p>
<p>Returns the list of notebooks (called "folders" internally) as a tree. The sub-notebooks of a notebook, if any, are under the <code>children</code> key.</p>
<p>Creates a new note. You can either specify the note body as Markdown by setting the <code>body</code> parameter, or in HTML by setting the <code>body_html</code>. All parameter are optional.</p>
<td>If <code>body_html</code> is provided and contains relative URLs, provide the <code>base_url</code> parameter too so that all the URLs can be converted to absolute ones. The base URL is basically where the HTML was fetched from, minus the query (everything after the '?'). For example if the original page was <code>https://stackoverflow.com/search?q=%5Bjava%5D+test</code>, the base URL is <code>https://stackoverflow.com/search</code>.</td>
<td>An image to attach to the note, in <ahref="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs">Data URL</a> format.</td>
</tr>
<tr>
<td>crop_rect</td>
<td>If an image is provided, you can also specify an optional rectangle that will be used to crop the image. In format <code>{ x: x, y: y, width: width, height: height }</code></td>