cweirup / JoplinSafariWebClipper

Safari App Extension for Joplin Web Clipper
MIT License
121 stars 11 forks source link

Missing files -> does not compile #1

Closed kwasmich closed 4 years ago

kwasmich commented 4 years ago

Hi, thanks for your effort making a web clipper Safari Extension for Joplin. I instantly wanted to try it but the git repository unfortunately lacks 6 files:

JSDOMParser.js Readability-readerable.js Readability.js led_green.png led_orange.png led_red.png

While it is easy to guess the content of the images, it is hard to tell what is inside the missing JavaScript files.

Looking forward to see the missing files.

cheers!

cweirup commented 4 years ago

Wow, thanks for checking this out! Please note that this is still VERY Alpha code this point. The only things working are Clip URL and Clip Complete Page. Quite a bit (most?) of it doesn't work. Tags are the most obvious missing feature. It doesn't have Selection or Screen Image capture either. You also have to select the Folder each time, as it doesn't remember the last one you selected. Yeah, lots to work on :).

It also operates differently than the official Chrome extension, in that it clips the content immediately; you don't "Submit" once you select an option.

I've loaded the JSDOM and Readability files in, although the Extension currently doesn't use them so it's strange about the build error. I removed the led_*.png files, as those are all now managed in an Asset Catalog. That should allow you to build it. Let me know how that goes.

Chris

kwasmich commented 4 years ago

Thanks. Now it compiles! It also detects my local Joplin with enabled Web Clipper Service. But it does not seem to do anything else. It does not load the folders, nor are the pages saved in any way.

I haven't developed Safari Extensions before. Is there a nice way of code debugging except spamming the system log with calls to NSLog?

Keep up the good work! Cheers!

cweirup commented 4 years ago

One thing to check is that Joplin is actually running, although it sounds like you already have. I've been going over the code, and I'm finding some bugs with my Web Clipper Service code. It's going to take me a little bit of time to fix (due to other commitments), but that might be why it shows it's connecting to the Clipper Service when it really isn't. Try shutting down Joplin and see if the Extension still thinks that the server is running. If it does, then you'll know it's running into a problem.

One other thing I'm trying to fix is that the first time you launch the Extension pop-up, the Folders don't load. If you close then reload the Extension pop-up on the same web page, they should show up. There's an issue with how I'm handling the completion handlers of the web service calls that I need to work on.

I've found that using NSLog is the "easiest" way. I'm also pretty new to this, but it appears that this is standard. One thing that may be easier is to switch your target from the main app to the Extension. It will ask you to select an application to run; you'd select Safari. This is supposed to allow you to do easier code breaks and view output from the Xcode console, although I haven't had luck with that. It's been easier for me to use the Console with NSLog.

Once I get some time to look into this, I can let you know if I find anything else.

cweirup commented 4 years ago

@kwasmich Try building and running from the latest code. I fixed a few things, including a pretty nasty bug where the Extension continuously crashed in the background. I'm wondering if that is what you were experiencing. Let me know how that turns out.

kwasmich commented 4 years ago

Now it works like a charm! Keep up the good work and If you need someone to test your code changes, just hit me. cheers!

cweirup commented 4 years ago

Great news! I appreciate you checking this out, and I might take you up on that offer. Simplified Page clipping also now works, so give that a try.

Thanks! Chris

kwasmich commented 4 years ago

Works like a charm. To me it looks like the "Reader-View" from Safari. The only unexpected thing is: the custom title only works for Clip-URL. Both other take the title or heading.

cweirup commented 4 years ago

Cool. I actually just fixed the custom title issue when clipping the full page (complete or simplified), so you would need to rebuild for that to work. Thanks!

kwasmich commented 4 years ago

Works as advertised! Also the creation of tags works. And those even with auto completion!

kwasmich commented 4 years ago

To the best of my knowledge not even Evernote supports tagging of links in the web clipper.

cweirup commented 4 years ago

Glad it's working for you! Yeah, auto-completion is a nice feature. Hope to get some time in the next couple of weeks to do some more clean-up work on it.