emad-elsaid / xlog

💥 Personal knowledge management application. One binary HTTP server. works in any Markdown directory. autolinks pages, hashtags, auto preview images link, screenshare, screenshot, camera recording and audio recording embedded in the note. and fast search through the KB
https://xlog.emadelsaid.com
MIT License
154 stars 15 forks source link

safari not rendering #30

Open gedw99 opened 1 year ago

gedw99 commented 1 year ago

On mac On master branch.

Chrome works fine.. Safari not..

Chrome:

Screenshot 2023-04-07 at 13 35 15

Safari:

Screenshot 2023-04-07 at 13 35 22
gedw99 commented 1 year ago

In Safari when you click edit, you cant edit the text

emad-elsaid commented 1 year ago

I don't have a MacOS laptop to debug this but I can help to try and find the issue.

  1. the edit page initialize a Codemirror editor.
  2. The javascript is loaded using browser import map feature
  3. it also uses localstorage to get the last cursor position

I suspect that one of the previous points fail or not supported by Safari.

  1. The first step is to inspect the browser developer tools console to check for the errors
  2. Can you try to do that and paste the error you get?
gedw99 commented 1 year ago

Hey @emad-elsaid

got a chance to play around a bit more...

On latest...https://github.com/emad-elsaid/xlog/commit/a9ae2a10394bfd98f4077989461c9bd0cff4ccb0

Mac Safari

Editing works now. Weird but anyways..

Saving is where i get the error: "Forbidden - CSRF token invalid"

https://github.com/emad-elsaid/xlog/assets/53147028/63d3d806-b39c-4745-98a2-d112fed2642b


Safari Technology Preview

Editing fails - not sure why right now.

https://github.com/emad-elsaid/xlog/assets/53147028/a61c4a14-88d3-4f43-b88d-6fbfc7fd20c6

gedw99 commented 1 year ago

The bug is because we change paths when we post back from the browser to the Server, and so we need the path added.

this is the fix i think: https://github.com/livebud/weblog/issues/1#issuecomment-1281676880

emad-elsaid commented 1 year ago

but isn't this what's happening here? https://github.com/emad-elsaid/xlog/blob/master/server.go#L43

gedw99 commented 1 year ago

I have to let this one go for now as super busy moving countries..

Hopefully someone else with Mac / safari can pick this up …