Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] QOwnNotes browser clipper shortcuts and the ability to do both a screenshot and a html to markdown at the same time in the same note (For archiving) #17

Closed
wadbr opened this issue May 5, 2020 · 16 comments
Labels
enhancement New feature or request
Milestone

Comments

@wadbr
Copy link

wadbr commented May 5, 2020

Hello, first I just want to say thank you for this amazing app and the INSANE development that has gone into it, it has saved me hours of frustration!

Expected behaviour

  • One button to both do a screenshot (display it at the top of the note) and a html to markdown (the current normal behaviour)
  • add shortcuts for these actions

Actual behaviour

  • screenshots: both save seperatly
  • shortcuts: there's one shortcut and it's "activate this plugin"

Why

  • the text clipping does not save format (and actually sometimes misses content, but that's normal modern html weirdness)
  • having both the text and the format will be great for archiving both the text so it's searchable and the format of the site
  • shortcuts are awesome :D !

(also small non-essential requests: change capture image format to PNG, it is currently in low quality JPEG, and if it is possible to do a full page scrollable screenshot that would be amazing)
(Sorry about posting this in the main repository)

@pbek
Copy link
Member

pbek commented May 5, 2020

Thank you for your kind words and your suggestion.

@pbek pbek added the enhancement New feature or request label May 5, 2020
@pbek
Copy link
Member

pbek commented May 10, 2020

You will be able to write your own script to handle it the way you like.

20.5.0

  • screenshots are now captured as png instead of the browser's default format to capture screenshots
  • the context menu entries Create note from page (HTML import) and Create note from selection
    where renamed to Send page to QOwnNotes and Send selection to QOwnNotes, because now a screenshot of the current page will also be sent to QOwnNotes so you are able to use them in scripts
    • you need QOwnNotes 20.5.7 or higher for this feature
    • the default behavior is still that a new note is created with the page or selection text

@wadbr
Copy link
Author

wadbr commented May 10, 2020

You are a beautiful human being! I will try them out very shortly and write out a script to use them, thank you very much!

@pbek
Copy link
Member

pbek commented May 10, 2020

Thank you. 😁 Was a lot of work already, needs some more work. Plus all the script tooling needed to be implemented in QOwnNotes...

@pbek
Copy link
Member

pbek commented May 10, 2020

add shortcuts for these actions

I don't think that's possible, I haven't found a way to implement this.
See: https://developer.chrome.com/extensions/contextMenus#method-create

Have you seen any browser extension having shortcuts for context menu items?

@wadbr
Copy link
Author

wadbr commented May 10, 2020

add shortcuts for these actions

I don't think that's possible, I haven't found a way to implement this.
See: https://developer.chrome.com/extensions/contextMenus#method-create

Have you seen any browser extension having shortcuts for context menu items?

Again thank you so much for your hard work! I haven't had the time to test this yet but I do use an extension that has shortcuts for actions that are also in the context menu. I do not think the context menu and the shortcuts are related I think they are just hard coded, but something like this will work for this purpose I think:

image

https://github.com/darktrojan/openwith


EDIT: The Great Suspender also seems to have all of its context menu options as shortcuts

image

https://github.com/deanoemcke/thegreatsuspender

@pbek
Copy link
Member

pbek commented May 10, 2020

Thank you for the examples. A quick look at it tells me that takes more time to reverse engineer how they did it... 😬

@wadbr
Copy link
Author

wadbr commented May 10, 2020

Thank you for the examples. A quick look at it tells me that takes more time to reverse engineer how they did it... 😬

Honestly, what you did already is more than enough, you can close this issue if you want to. Thank you again!

@pbek
Copy link
Member

pbek commented May 10, 2020

If you want you can post a different shortcut feature request with the information you found.

@pbek
Copy link
Member

pbek commented May 11, 2020

QOwnNotes 20.5.7

  • there now is a new method insertHtmlAsMarkdownIntoCurrentNote for mainWindow
    in the scripting engine that inserts html in the current note as markdown
    (for #1740)
    • this method also downloads remote images and transforms data:image urls
      to local images stored in the media directory
    • for more information please take a look at the
      Mainwindow scripting documentation
  • added a new scripting hook websocketRawDataHook that is called when data is
    sent from the QOwnNotes Web Companion browser extension via the web browser's
    context menu (for #1740)
    • you need the QOwnNotes Web Companion 20.5.0 or higher for this to work
    • this works with either the send page and send selection feature of the
      web companion
    • if a hook implementation is found in a script no new note will be created
    • take a look at the
      handleNoteNameHook documentation
      for more information

There now is a new release, could you please test it and report if it works for you?

@pbek
Copy link
Member

pbek commented May 11, 2020

Don't forget to update the QOwnNotes browser extension!

@wadbr
Copy link
Author

wadbr commented May 12, 2020

I'm sorry about replying late. I just tested this out with the new chrome extension and it worked beautifully. The PNGs are way better quality wise, thank you!

I had this error in the chrome extension but I do think it is because my firewall blocked the new qownnotes executable before it could connect

image

They only happened once (and disappeared after closing the window, sorry for not grabbing a log) and everything is still working fine after I got them.

@pbek
Copy link
Member

pbek commented May 12, 2020

The chrome web-store still shows me 2019.7.0, did you install the new version manually?

I had this error in the chrome extension but I do think it is because my firewall blocked the new qownnotes executable before it could connect

If QOwnNotes is not running (or responding) that could trigger such an error. It should end with an alert dialog in the extension.

Did you already try to write a script with the new hook? The example script on the documentation page should be very close to what you asked for. If you want you can push a pull requests to https://github.com/qownnotes/scripts with a script you made.

@pbek
Copy link
Member

pbek commented May 12, 2020

The chrome web-store still shows me 2019.7.0

or are you on Firefox? there the update already went through...

@wadbr
Copy link
Author

wadbr commented May 12, 2020

I'm on chrome and I did update manually through the zip file in this repository, the store still hasn't updated.

I will probably push the script once I have a good working version!

@pbek
Copy link
Member

pbek commented May 12, 2020

Great, keep me posted then (or tell me if you need help). 😁

@pbek pbek closed this as completed May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants