Safenote v1.0: Safe's post-it for Chrome

Here’s something I’ve been working on to get myself started with the SAFE API. It’s nothing groundbreaking but I thought some of you might find it useful or interesting.

So Safenote is an extension for the Chrome browser. It allows you to write a note for the URL you are currently viewing and save it on Safe. All notes are saved on Safe so using Safenote on another computer allows you to share the notes between them.

Keep in mind that your notes are also saved in the local storage of your browser. Other extensions or webpage can’t access them but someone with an access to your computer could.

Since I didn’t want to distribute it through the Chrome web store you need to load it manually, the steps are explained below. Once unpacked you’ll be able to look at the code and tinker with it if you want.

How to install

  • Go to safenote.davidmtl.safenet (alpha network) and download the zip file. Extract it and follow these installation steps:

  • In Chrome, access the extension page by entering this in the url box.

  • Load the extension by checking the “developer mode” check box and pressing the “Load unpacked extension…” button.

How to use

  • To create a note press the Safenote icon on the right of the browser and to open the page that allows to save it on SAFE press the “Save on SAFE” button.

SAVE on Safe page:

  • This page will request authorization automatically to the SAFE Launcher when it opens.
  • Press SAVE to save the note on Safe.
  • Press DELETE to delete the note both locally and on Safe.
  • Press “Reset authorization” to redo the authorization step.
  • Press “Refresh local changes” if new local changes doesn’t show up in the list.
  • Press “Restore from SAFE” to get all safenotes from SAFE and download them locally.

That’s it, feel free to give feedbacks.

23 Likes

This is great, you can make individual notes on each tab.

Question, where is the SAFE Drive Access? (I thought this would be public/private data in my demoapp, but I don’t see nothing there) So where are the safenotes stored?

3 Likes

Hi @19eddyjohn75, I’m glad you tried it. Safenotes are saved in the root directory of the Safenote app which I believe is private by default. I’ll try changing this for a public subfolder instead so other app can access the same data. I don’t know yet if doing that will allow you to see the files in the demo app, I suspect it won’t. I had plan to make a simple webpage to look up the content of any public folder, I might do that next, should be handy.

5 Likes

I would think that this means that they are in your possession.

Huh doesn’t this mean that everybody could access it?

[quote=“DavidMtl, post:3, topic:10991”]
I don’t know yet if doing that will allow you to see the files in the demo app, I suspect it won’t.
[/quote]To my limited knowledge it’s not possible for you to get data in my demoapp unless, you have my SAFE launcher creds and make a PUT request.

If data could be transferred to the demoapp directly by apps, this would enable us to store a backup of our wallet, without downloading the wallet backup to our insecure computers. It would also help if you could cut data from your desktop and paste it in your demo app (maybe this would be possible with Lifestuff, since your computer thinks it’s just another drive). Likewise cut data from privatefolder and paste it in your publicfolder.

It would more accurate to say that they are in your possession and your SAFE Launcher gives exclusive access to the Safenote app you authorized. They are really not in my possession, I can’t access your data.

I think you are right, what I meant is to store them in a subfolder on the SAFEDrive(which is a different place than the root directory of the app folder). According to the documentation, the SAFEDrive is meant to share data between user apps and not between users. I’m still a bit confused about this so we’ll see.

I don’t know at this point if the demo app shows the content of the SAFE drive or not. If it does and Safenote records its data there, you should be able to see them. Really not sure. I’ll check that out later tonight soon.

1 Like

It doesn’t, and I don’t know why because cretz command line app can see public files I store with my apps. For some reason the demo app doesn’t though (I have asked why on github).

3 Likes

Scratched my head about this too earlier trying out your code for a basic demo on how to make an API call …

Sure, “get” and “remove” returned ok but where had they been off to?

1 Like

Yeah I know, I was disappointed at first that I couldn’t see my files in the demo app. Maybe it should be a feature of the launcher, a basic file explorer where you can see all files of all apps private or not.

I replied to the issue @happybeing had raised. Hope it clarifies the notion of public and private directories.

1 Like

I think I’m gonna look at @cretz’ CL code and hope that will help too. Feels like a jigsaw puzzle without the corner pieces in place ATM :wink: Maybe those pieces will turn up in the tutorials being worked on!?

I opened a topic for discussing how apps can share files on the Dev forum:

1 Like