Git Product home page Git Product logo

Comments (14)

appledispatch avatar appledispatch commented on June 25, 2024

I just posted an article for my publication, Apple Dispatch, about integrating SingleFile, Apple Notes and Safari that is relevant to this suggested feature request and also how to harness the power of SingleFile in general.

The way that I'm sharing items now is by Right-clicking the downloaded HTML file, selecting Share…, and then choosing Notes. It would be great to have the tighter integration built directly into the Safari Share Sheet.

Thanks for your continued efforts on such an amazing tool!

from singlefile.

gildas-lormeau avatar gildas-lormeau commented on June 25, 2024

Thank you very much for the article. I did a quick test in Safari and it looks promising. The good news is that it supports the navigator.share() API.

FYI, here is the test I did:

  1. Open https://www.example.com in Safari
  2. Open the JavaScript console (via the menu Develop > Show JavaScript Console)
  3. Paste the code below in the console and press Enter
document.onclick = () => navigator.share({ files: [new File([ document.documentElement.outerHTML ], "example.html")]})
  1. Click anywhere on the page
  2. A popup should allow you to add the page in Notes

I will do a more advanced integration test in SingleFile, I'll keep you informed ;)

from singlefile.

appledispatch avatar appledispatch commented on June 25, 2024

That is absolutely fantastic! I just ran the code you posted and it works perfectly! Thanks for sharing it.

I noticed if I click away from the share sheet, without sharing to Notes, I get these errors in the console: (Unhandled Promise Rejection: InvalidStateError: share() is already in progress) and this one: (Unhandled Promise Rejection: AbortError: Abort due to cancellation of share.) Maybe this is the intended behavior?

I put the word out about my article highlighting SingleFile over at the excellent /MacApps subreddit and they are really digging it there. It’s turning on a lot of people (≈ 3.9k currently) to your wonderful extension in the Apple community.

Yes indeed, please keep me in the loop as things progress. I will be posting about this @Apple Dispatch for my Apple Notes series once this feature becomes a reality.

Truly exciting developments!

from singlefile.

gildas-lormeau avatar gildas-lormeau commented on June 25, 2024

It's implemented. I added a new option share page in the Destination section. When checked, a banner with a Share page... button will appear at the top of the page when you save it. By clicking on this button, you will be able to share the saved page on Notes, see the screenshot below. Unfortunately, this button requires an extra click, but I have no choice from a technical point of view.

The new option will be available in the next version.

image

from singlefile.

appledispatch avatar appledispatch commented on June 25, 2024

Thanks so much for your excellent work on this new feature! I love to see SingleFile getting even tighter integration with Safari and Notes.

Can't wait to see this drop on the App Store.

from singlefile.

gildas-lormeau avatar gildas-lormeau commented on June 25, 2024

The new version (1.2.0) is available for download on the App store.

from singlefile.

appledispatch avatar appledispatch commented on June 25, 2024

This is absolutely killer! Is there a way for this new implementation to also work for Save selection to Notes?

from singlefile.

gildas-lormeau avatar gildas-lormeau commented on June 25, 2024

Actually, it should also work for selection if you use the context menu and select 'Save selection' instead of clicking on SingleFile button.

from singlefile.

appledispatch avatar appledispatch commented on June 25, 2024

That's great! Is there a way for the 'Share page…' button to change to 'Share selection…' when choosing that option from the context menu?

from singlefile.

gildas-lormeau avatar gildas-lormeau commented on June 25, 2024

Thank you for the suggestion, it is fixed. The fix will be available in the next version.

from singlefile.

appledispatch avatar appledispatch commented on June 25, 2024

Any time. Well done!

from singlefile.

appledispatch avatar appledispatch commented on June 25, 2024

Is there a way to get macOS Spotlight to index the HTML files saved by SingleFile? It seems that files saved to Apple Notes can only be searched by title and not by the text contained within each HTML document.

from singlefile.

gildas-lormeau avatar gildas-lormeau commented on June 25, 2024

I don't think it's possible. It looks like it's a "bug" in Notes, see https://discussions.apple.com/thread/251960240?answerId=253757819022.

However, you can search for attached pages with the Finder in ~/Library/Group Containers/group.com.apple.notes/Accounts.

from singlefile.

appledispatch avatar appledispatch commented on June 25, 2024

You're definitely on to something with that Apple Discussion thread. I was able to find out that Spotlight will index and search text content within Safari webarchives, but Notes cannot do the same. It looks like Apple did not implement that part of the Spotlight Index API in Notes.

So, it seems pretty clear why Notes cannot search SingleFile archives, but I'm still not sure why Spotlight can't search them. Maybe, Apple only allows the API to work on its own HTML archive format?

from singlefile.

Related Issues (20)

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.