GithubHelp home page GithubHelp logo

zadam / trilium-web-clipper Goto Github PK

View Code? Open in Web Editor NEW
243.0 243.0 51.0 221 KB

Save web clippings to Trilium Notes.

License: GNU General Public License v3.0

JavaScript 95.47% Shell 1.61% HTML 2.57% CSS 0.35%

trilium-web-clipper's People

Contributors

alteist avatar contributor avatar jrao1 avatar kubeliv avatar manto89 avatar meichthys avatar siralmat avatar zadam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trilium-web-clipper's Issues

(Feature Request) Check if the current page is already saved in trilium

Summary

When opening the main menu, it will be useful to see if the current page was already captured (with clippings or notes) in trilium.

Current Behavior

--

My proposal

Add a link in the main menu if there's a note (under the Inbox or under the special clipperInbox note) that has a label pageUrl with the same url as the current page. In that case show a link to view it on trilium.
Screenshot 2023-07-02 at 14 28 07

Additional Notes

I already worked on a PR for this, will link it asap

[Android] Does not work with WireGuard VPN

Hi, my trilium instance is only available through a wireguard vpn, which works fine for desktop and web versions, incl. web-clipper on chrome on my desktop, however the android version does not connect.

Suggestions on Safari support (macOS and iOS)

The web-clipper helps me a lot. I use it every day. However, the lack of support on Safari(macOS and iOS) has been bothering me, especially when I want to save web pages to Trilium on my iPad. Now, I have to transfer to Chrome from Safari on my MacBook.

Today, I found the 'safari-web-extension-converter' tool, which is developed by Apple officially, can convert the trilium-web-clipper(Chrome version) to a Safari extension with just several clicks, and it seems to work well on Safari (MacBook, Big Sur 11.2.1).

Also, Apple promises the support of safari extensions on iOS15 at recent WWDC. The converted extension may also work well on iOS. This can bring the excellent feature to the iOS platform, since we know Chrome does not support extensions on any mobile devices.

So it would be much appreciated if you could provide the Safari support, and perhaps, the converter may help.

The introduction of the tool can be found at https://developer.apple.com/documentation/safariservices/safari_web_extensions/converting_a_web_extension_for_safari
An example
https://bartsolutions.github.io/2020/11/20/safari-extension/

It cant clip from Linkedin

Hi

I am using Firefox version of the extension with the desktop version Windows.'

(Firefox 110, Windows 11)

  • Linkedin jobs
  • search for a job
  • click one from the list
  • select all the job description
  • right click -> save selection to trilium
  • open trilium
  • the new page is named as "search all jobs linked in"
  • the actual page has no content

Saving the whole page seems to work so this is not a login or some other weird issue, it seems like it is not able to grab the selection.

Local extension development issues

I forked the repo to make a few changes (e.g. adding keyboard shortcuts) and ran into some teething problems while getting a local build up and running. I got there in the end, but wanted to share my experiences and suggest adding a short development section to the readme to help others get started.

  1. The April commit 338f01b replaced browser-polyfill.js with its npm package; previously the compiled library was included. I assumed this was unintentional and just dropped in the updated library.
  2. When running in a dev environment, the extension uses a different port range to connect to the desktop client. I fixed this by specifying the port in the extension options, but I think a note in the readme would be helpful. A couple of related points:
    • Viewing the current port from inside the client (MacOS) is a little non-obvious. I found it by opening the backend log and scrolling back to the server startup message. I can't see a way to change the port within the UI either.
    • It seems that the port scan will trigger every 60s indefinitely, which seems unnecessary when Trilium will likely remain available on the same port. After finding a client, shouldn't the extension persist the port for the session and only trigger a new scan if a connection fails? Can local scans be disabled for cases where the user only has a server instance?
  3. The release scripts depend on sponge, jq, and the GNU date utility (the iso-8601 option is not supported on MacOS). Of course, not an issue for anyone other than the project owner anyway... just including for the sake of completeness 😜

Thanks for all your hard work on Trilium and this extension! I have keyboard shortcuts working (shockingly simple to implement) and am planning to submit a PR if that's OK, though the default shortcuts need testing to make sure they're valid for other platforms.

Trilium Web Clipper edit note disappear

Dear Trilium developer,

When I use Trilium Web Clipper use 'Save whole page' this feature, notes can be saved in client.
But when using note client use edit note feature, this notes will disappear.

Kind Regards,
Fordring

#clipperInbox not used for all clips

First, thank you for the amazing software. I replaced Notion and have never regretted if.

I am finding that Items saved from the webClipper are not always put in the location specified by the #clipperInbox attribute.

Findings:

  1. Add the #clipperInbox attribute to a note and ensure no other note has that attribute
  2. Install Trilium WebClipper
  3. Select Cropped Screenshot option from Web Clipper. Expected: New note in the Inbox Result: Note present - Pass
  4. Select Whole Screenshot option from Web Clipper. Expected: New note in the Inbox Result: Note present - Pass
  5. Select Save Whole Page option from Web Clipper. Expected: New note in the Inbox Result: Note in Daily Journal - Fail
  6. Select Link with note option from Web Clipper. Expected: New note in the Inbox Result: Note in Daily Journal - Fail
  7. Select Save List of tabs option from Web Clipper. Expected: New note in the Inbox Result: Note in Daily Journal - Fail

Environment:

Browser: Chrome 116.0.5845.96
OS: macOS Sonoma 14
Trilium: Version. 0.61.5-beta (DB Ver: 225, Sync Ver: 31, Build Date: 2023-08-16T23:02:15+02:00, Build revision: 3f7a5504c77263a7118cede5c0d9b450ba37f424)
WebClipper: version 1.0.1
Server: Running from a Docker Container in a Digital Ocean Droplet

PROBLEM: Server settings syncing across devices

If you are logged in to Mozilla sync the settings for the server from the clipper are synced. This isn't good as I use different settings on my win10 PC than I do on my Linux server where the trilium server is running.

Mobile friendly?

Hi

Is it possible to make it so that it also works on mobile FF?

I can installed it on Android FF but trying to save a web page throws Calling browser runtime failed.R efreshing might help

Web Clipper is decomissioned

Hello, Trilium is in maintenance mode now. The secondary projects, like the Web Clipper, are decomissioned. There won't likely be a new release.

CSS inherited from webpage

The extension's popup inherits the font CSS from the current webpage. Maybe it should have its own CSS rules if that makes more sense. Often if the site's font is black or grey this makes the popup unreadable

No way to cancel screenshot

If you begin a clip by screenshot, you cannot cancel it. A non drag click will still make a note with no screenshot.

Improvements:

  • Clicking once without dragging area should cancel.
  • Escape should cancel operation.

(feature request) Screenshot Entire Page

Currently we have the option to screenshot an area (great!). OneNote has an additional option to screenshot entire page - this makes a single .png screenshot of the entire page regardless of how long it is. This would be a lovely feature in Trilium.

Unclear which license project is under

I've been asked to add Trilium Web Clipper to a Firefox add-on package set that I maintain. To do so I need to mark which license the package is under. Would you mind clarifying which license(s) applies to this repo?

[issue] How can I find the required "username“ when using "Trilium server instance"

I am using Trilium with docker instance. It means that I download Trilium from dockerhub and launch it with docker. It works. When I was using the "setup" page to set the password, it did not ask me to select a username. And I do not find the username in the "options" menu. So I think Trilium does not require a password.
I also want to use trilium-web-clipper with the Trilium instance. But I can not even log in to the system. trilium-web-clipper requires a username and password. But I only have the password.
How can I work it out? Is there any default username for Trilium, or Trilium does not need the username anymore?

Runtime error when clipping local html-files with images

Trilium's Web Clipper works flawless, when it comes to clipping articles from the internet. Same goes for local html files.

However, when trying to clip a local html file with images (also stored locally) in it, nothing gets clipped, and this error turns up: Calling browser runtime failed. Refreshing page might help.

Page refresh in the browser makes no difference.

Changing the image source from relative to absolute path (starting with file:///F:/ etc.) does not solve the problem. Nor does removal of inline styles like style="width:16pt;height:16pt;" from the image tags.

Images from pages on the internet get transferred like a charm. It would really be a step forward, if the same were the case for locally stored images.

Setup:

Windows 10 with local Trilium (no server).
Trilium 0.38.2.
Web Clipper: trilium_web_clipper-0.1.1-an+fx.xpi on Firefox.

[Feature Request] Ability to pin links onto an image

Hello,

first and foremost, I am absolutely astonished by the depth and feature richness Trilium offers. Incredible work, thank you!

For my use case I'd like to request the ability to pin links onto an image file. Eg if I have a world map, I'd like to put a pin (idealy with a customizable icon) onto country X, City Y or River Z. I can then click on said link and be lead to the appropriate entry. If this is already possible, I'm sorry, I seem to have missed that. If not this would be incredibly useful for a great many use-cases.

Cheers
Sir Motte

[Feature Request] Option to configure Trilium destination node

I just recently discovered the Firefox extension and I am very impressed! Great work!

Currently snips are saved to a Calendar node:
image

It would be nice to be able to configure a different destination for clips. My idea was to be able to specify a node like 'Inbox' where i could save clips and then file them away to different nodes at a later time.

Only getting a small portion of page

I have xpi extension installed on Firefox and clicking 'Save Whole Page'. I get a pop-up dialog at the bottom of the screen. When I click the link and go to Trillium, I only get a small portion of text from the page. Am I doing something wrong?

For example, say I do a google search for 'nothing'. All I get is the top of the page.

image

"openNoteInTrilium" not working for "open-in-browser"

Recently, I set up the web clipper to work with the Trilium server instance. It seems the Link "Open Note in Trilium" from the "Save Selection to Trilium" is not working. The link in fact opens the Trilium web interface, but it does not navigate to the newly created note.

According to

const noteUrl = triliumServerUrl + '/#' + request.noteId;
a URL is generated according to the pattern triliumServerUrl + '/#' + request.noteId. However, the latter part with the noteId is apparently ignored by the web application.

Unknown error: Failed to fetch on docker instance

Hello,

I've just recently setup a Trilium container on a random port 32768. I'm trying to set it up on the extension but it's coming up with:
Unknown error: Failed to fetch on docker instance
image

With or without port being specified it generates the same error. It's like it's not even reaching the server.

(Feature Request) Keep the title when adding notes

Summary

When using the Save Link with a Note i want to add some custom text while keeping the page title.

Current Behavior

When adding some text to the textarea in Save Link with a Note the page title is lost, the first line of the textarea is used as the note title, the rest as note content.
If the textarea is left empty, the note will have the page title as note title and an empty body.

My Proposal

Keep the behavior as is, but add a checkbox under the textarea to keep the page title as note title. In this way all the text in the textarea will be used as the note contet
Screenshot 2023-07-02 at 14 16 36

Additional Note

I already worked on a PR for this, will link it asap

[Feature Request] Make 'Save the whole page' also take lists into account

If you try to save pages like Recipe the ingredient list gets fully ignored because the Readability probably decides that the length of it is too small to even consider to be valid content.

It would be nice if there was some kind override/option to add value to a specific class/word and all its children so they do get included in the save page macro.

Right now the only way to do it seems to add the class name to the positive REGEXPS list by recompiling the whole plugin

Potential Harm Of Clipping Pages With JavaScript, Trackers, etc..

Does web clipper copy a web page verbatim? ie If clipping a web page that includes harmful javascript code, or ads, cookies, etc... and you view the clipped content through the trilium frontend, would you be at risk of any potential information leakage, or potentially executing harmful javascript code?

Web clipper unable to connect to server

I am using latest zadam/trilium docker image and web-clipper version 0.3.1.

I tried steps in #41 but still not able to login to server.

image

docker logs:

200 GET /api/health-check with 15 bytes took 1ms
POST /api/login/token returned 401 with response "Incorrect password"
Slow 401 POST /api/login/token with 18 bytes took 303ms
POST /api/login/token returned 401 with response "Incorrect password"
Slow 401 POST /api/login/token with 18 bytes took 131ms

Browser: Firefox 105.0.1 (64-bit) Windows 10
Web clipper version: 0.3.1
trilium server version: Latest image from dockerhub.

Web clipper fails on GitHub issues with a strange message

For example, attempting to clip zadam/trilium#257 results in:

Support for custom fonts · Issue #257 · zadam/trilium

Attach files to your comment Attach files by dragging & dropping, selecting or pasting them.

<octocat-spinner-32.gif>

Uploading your files… We don’t support that file type. with a GIF, JPEG, JPG, PNG, DOCX, GZ, LOG, PDF, PPTX, TXT, XLSX or ZIP. Attaching documents requires write permission to this repository. with a GIF, JPEG, JPG, PNG, DOCX, GZ, LOG, PDF, PPTX, TXT, XLSX or ZIP. We don’t support that file type. with a GIF, JPEG, JPG, PNG, DOCX, GZ, LOG, PDF, PPTX, TXT, XLSX or ZIP. Yowza, that’s a big file with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.


Saving a selection from the page via. the context menu works fine.

Add option to prompt for attribute

It would be nice to have an option in settings that when enabled, it would prompt() in javascript for an attribute to add to the note each time you saved a note. I usually want to categorize my clippings and opening in trilium each time to add a single attribute makes it a bit more inefficient. Example using javascript's default prompt

var attr = prompt("Please enter the attribute you want to add to the note.");

image

ERROR: Error executing transaction, executing rollback. Inner stack: Error: Note title must not be empty

Details

Whenever I try saving pages with the clipper on firefox I keep getting this error. I was able to save one page successfully, but now keep getting errors.

Error

21:30:43.928 INFO  POST /api/clipper/notes
21:30:43.931 INFO  ERROR: Error executing transaction, executing rollback. Inner stack: Error: Note title must not be empty
    at Object.createNewNote (/home/solidity/Programs/trilium-linux-x64-server/src/services/notes.js:105:15)
    at async createNote (/home/solidity/Programs/trilium-linux-x64-server/src/routes/api/clipper.js:74:20)
    at async /home/solidity/Programs/trilium-linux-x64-server/src/routes/routes.js:92:32
    at async /home/solidity/Programs/trilium-linux-x64-server/src/services/sql.js:220:19
Outside stack: Error
    at Object.transactional (/home/solidity/Programs/trilium-linux-x64-server/src/services/sql.js:211:23)
    at /home/solidity/Programs/trilium-linux-x64-server/src/routes/routes.js:91:38
    at /home/solidity/Programs/trilium-linux-x64-server/node_modules/cls-hooked/context.js:118:13
    at Namespace.run (/home/solidity/Programs/trilium-linux-x64-server/node_modules/cls-hooked/context.js:97:5)
    at Namespace.runAndReturn (/home/solidity/Programs/trilium-linux-x64-server/node_modules/cls-hooked/context.js:117:8)
    at Object.init (/home/solidity/Programs/trilium-linux-x64-server/src/services/cls.js:5:28)
    at /home/solidity/Programs/trilium-linux-x64-server/src/routes/routes.js:85:38
    at Layer.handle [as handle_request] (/home/solidity/Programs/trilium-linux-x64-server/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/solidity/Programs/trilium-linux-x64-server/node_modules/express/lib/router/route.js:137:13)
    at checkToken (/home/solidity/Programs/trilium-linux-x64-server/src/services/auth.js:67:9)
21:30:43.931 INFO  Creating clipped note from https://www.cs.swarthmore.edu/~newhall/unixhelp/C_arrays.html
21:30:43.931 INFO  ERROR: post /api/clipper/notes threw exception: Error: Note title must not be empty
    at Object.createNewNote (/home/solidity/Programs/trilium-linux-x64-server/src/services/notes.js:105:15)
    at async createNote (/home/solidity/Programs/trilium-linux-x64-server/src/routes/api/clipper.js:74:20)
    at async /home/solidity/Programs/trilium-linux-x64-server/src/routes/routes.js:92:32
    at async /home/solidity/Programs/trilium-linux-x64-server/src/services/sql.js:220:19
21:30:45.970 INFO  POST /api/recent-notes
21:31:27.156 INFO  GET /api/clipper/handshake
21:31:27.159 INFO  GET /api/clipper/handshake rejected with 401 Not authorized
21:31:27.215 INFO  GET /api/clipper/handshake

Inacurate error message

catch (e) {
console.log("Sending request to trilium failed", e);
toast('Your request failed because we could not contact Trilium instance. Please make sure Trilium is running and is accessible.');
return null;
}

Any exception is catched, and returns this message about "failing to contact trilium instance".
So any bug or issue is mistaken by the user as a network error.
A consequence of this is loosing potential people posting issues here, and making debug more difficult.
An easy way to access e error should be easily viewable, in order to ease debugging and posting of issues.

I personally just has this kind of issue, and not being very aware of how javascript works, i'm not even capable of finding where the output of 'console.log()' is.
(i was trying to send a page to trilium from a specific site and it doesn't work, while still working on other sites)

Doesnt Work With HTTPS

If your server is listening on HTTPS, it doesn't look like you can connect to it as the web clipper attempts to connect to http://...

web clipper check doesn't find server

my server is running on port 8080. i can get to the login page on the browser. I enter the port in option and hit save. close options. click on the toolbar icon and click check and get "not found".

Just downloaded the server beta and the latest firefox extension. linux ubuntu desktop.

web clipper says configured, checker can't find

I have web-clipper server defined. the server is behind a site with basic HTTP auth enabled. When I configure the server the first time it asks for the auth login/password. also a browser tab is open from the same site, but not trilium. when I click the check button I get not found. i open trilium in the browser, go to options, delete current set up, and re-enter. says already configured but accepts. click check and still not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.