elias-sundqvist / obsidian-annotator

A plugin for reading and annotating PDFs and EPUBs in obsidian.
GNU Affero General Public License v3.0
1.42k stars 63 forks source link

Annotator not renderring properly #356

Closed PrithiPal closed 5 months ago

PrithiPal commented 6 months ago

Problem: Obsidian Annotator plugin not rendering properly on obsidian screen. Details:

  1. When I create a new annotator page ( After creating new page --> Add property with annotator-target and annotator-target-type ) and switching to Annotate in Options ( three dots )
  2. Index panel on left side and Scroll view for pages renders, but not current page itself. When I click on of the pages on Scroll View, it renders the page, but disappears after I click on the page

Screenshot Examples:

System Info Obsidian Version: v1.5.1 Annotator Plugin version: 0.2.10

dalibord commented 6 months ago

I have the same issue in v1.5.2

peterkehlerjr commented 6 months ago

same here in v1.5.2

LespiletteMaxime commented 6 months ago

Same for me v1.5.2

ravitxyz commented 6 months ago

+1

Wcdaren commented 6 months ago

+1

stoweboyd commented 6 months ago

Me too. Totally unusable.

js0ny commented 6 months ago

Me too, after updating to v1.5.3

L1uYun commented 6 months ago

Me too, after updating to v1.5.3

skittleskittles commented 6 months ago

Same for v1.5.3

Marshallleung commented 6 months ago

same for 1.5.3

RijoRoriz commented 6 months ago

Same here, I need to roll back obsidian to v1.4.16 to make it work again.

eugenekavalchuk commented 6 months ago

+1, help please all versions

eugenekavalchuk commented 6 months ago

Same here, I need to roll back obsidian to v1.4.16 to make it work again.

How did you fix it? I rolled it back, but I'm still facing the issue

PrithiPal commented 6 months ago

Looks like @RijoRoriz is referring to obsidian version 1.4.16 and not "annotator" plugin version which I mistaken earlier. By the way, looks like some html tags are preventing from blob ( file abstraction in browser ), to be loaded by annotation plugin Screenshot 2023-12-26 111907

eugenekavalchuk commented 6 months ago

@elias-sundqvist, could you please check the issue? It has really broken a lot of work

RijoRoriz commented 6 months ago

Looks like @RijoRoriz is referring to obsidian version 1.4.16 and not "annotator" plugin version which I mistaken earlier. By the way, looks like some html tags are preventing from blob ( file abstraction in browser ), to be loaded by annotation plugin !

Yeah, I was referring to the Obsidian version, not the annotator plug-in.

@eugenekavalchuk maybe you can do the same temporarily.

eugenekavalchuk commented 6 months ago

Looks like @RijoRoriz is referring to obsidian version 1.4.16 and not "annotator" plugin version which I mistaken earlier. By the way, looks like some html tags are preventing from blob ( file abstraction in browser ), to be loaded by annotation plugin !

Yeah, I was referring to the Obsidian version, not the annotator plug-in.

@eugenekavalchuk maybe you can do the same temporarily.

Maybe I made a mistake? I downloaded versions 1.4.16 and 1.4.14, but nothing happened. The plugin is still broken.

CleanShot 2023-12-27 at 00 04 29@2x

upd. I've fixed it. I simply fully removed Obsidian and then reinstalled it, but remember to make a copy of the vault.

RijoRoriz commented 6 months ago

Looks like @RijoRoriz is referring to obsidian version 1.4.16 and not "annotator" plugin version which I mistaken earlier. By the way, looks like some html tags are preventing from blob ( file abstraction in browser ), to be loaded by annotation plugin !

Yeah, I was referring to the Obsidian version, not the annotator plug-in. @eugenekavalchuk maybe you can do the same temporarily.

Maybe I made a mistake? I downloaded versions 1.4.16 and 1.4.14, but nothing happened. The plugin is still broken.

You don't need to download the obsidian again. Just turn off the "Automatic updates": image

and delete the file ".asar" with the version:

Win: %appdata%/obsidian/obsidian-0.xx.xx.asar Mac: ~/Library/Application Support/obsidian/obsidian-0.xx.xx.asar Linux: ~/.config/obsidian/obsidian-0.xx.xx.asar

restart the obsidian after that!

ginozhu8 commented 6 months ago

+1 with obsidian 1.5.3

KristianS93 commented 6 months ago

Same had to roll back to 1.4.16, all annotations are saved in markdown, however, I cant view them in the annotator, very unfortunate.

andreaskrath commented 6 months ago

+1

dytan commented 6 months ago

extractly the problem, +1 with obsidian 1.5.3

RockRockWhite commented 6 months ago

same issue in 1.5.3

SMyPresious commented 6 months ago

same issue in 1.5.3

osrich commented 6 months ago

+1 in 1.5.3

FeelLiao commented 6 months ago

same issue in 1.5.3 hope to be addressed

ZhouO-v-O commented 6 months ago

same issue in 1.5.3 hope to be addressed

christiansmith commented 6 months ago

@RijoRoriz thanks for the details. I would have died from panic without a short term fix.

rryain commented 6 months ago

+1 in 1.5.3

Bingyudengren commented 6 months ago

+1 v1.5.3

nstebbins commented 6 months ago

@RijoRoriz thanks for the short-term fix! You da real MVP 👏🏻

terizhao commented 6 months ago

@RijoRoriz thanks for the short-term fix! Real MVP

WilliamsJack commented 6 months ago

It looks like this is due to a new CSP added to Obsidian's index.html in 1.5:

<meta http-equiv="Content-Security-Policy" content="style-src 'unsafe-inline' 'self' https://fonts.googleapis.com">

I haven't been able to fix the plugin directly, as it's a bit out of my area of expertise, but I did confirm the cause of the issue by unpacking obsidian-1.5.3.asar, removing the CSP from index.html and repacking it, allowing Obsidian Annotator to run on 1.5.3.

image

TimS-ml commented 6 months ago

@WilliamsJack Thank you!!! Works for me.

stoweboyd commented 6 months ago

Could you share the repacked asar?

On Sat, Dec 30, 2023 at 7:12 AM Jack Williams @.***> wrote:

It looks like this is due to a new CSP added to Obsidian's index.html in 1.5:

I haven't been able to fix the plugin directly, as it's a bit out of my area of expertise, but I did confirm the cause of the issue by unpacking obsidian-1.5.3.asar, removing the CSP from index.html and repacking it, allowing Obsidian Annotator to run on 1.5.3.

image.png (view on web) https://github.com/elias-sundqvist/obsidian-annotator/assets/30068301/1dafe69e-9aae-4c0b-b86c-0136290aff08

— Reply to this email directly, view it on GitHub https://github.com/elias-sundqvist/obsidian-annotator/issues/356#issuecomment-1872516525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXFR3RFL4T66EVV4M5TCGLYMAALZAVCNFSM6AAAAABAR4JGVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGUYTMNJSGU . You are receiving this because you commented.Message ID: @.***>

TimS-ml commented 6 months ago

@stoweboyd NP obsidian-1.5.3.asar.zip

PxaMMaxP commented 6 months ago

"I wrote"* a shell and a Powershell script. You just have to run it in the right directory. I wasn't entirely comfortable taking over the .asar file from someone else 😅

It is sufficient to add blob: to the CSP header. The script does that. Alternatively, the line should be changed as follows: <meta http-equiv="Content-Security-Policy" content="style-src 'unsafe-inline' 'self' https://fonts.googleapis.com blob:">

First you have to install npm (google is your friend) and then install asar with npm install -g asar.

At least for me under Windows it made sense to reinstall Obsidian once over the old installation. Otherwise it loads the .asar file from another folder.

So the original is located under C:\Users\[UserName]\AppData\Local\Obsidian\resources

Copy the script to this folder and execute it.

The original .asar file remains as a backup and only blob: is added to the corrected one.

Unfortunately, I do not know where the files are located under Linux/Mac. However, I have tested the shell script under Linux and it does what it should.

Maybe someone else can tell me which paths are the right ones under Linux/Mac.

AddBlobToCSP.zip


* ChatGTP is your friend 🥲

BaoDoanUit commented 6 months ago

I've solved this on Ubuntu with version 1.5.3

  1. Delete the old *.asar sudo rm -rf ~/.config/obsidian/obsidian-1.5.3.asar

  2. Unzip file and copy file to the config folder. obsidian-1.5.3.asar.zip sudo cp ~/Download/obsidian-1.5.3.asar ~/.config/obsidian/

  3. Then restart Obsidian

MatanRubin commented 6 months ago

Anyone knows how to do the same on macOS?

stone-sail commented 6 months ago

I have successfully solved this problem on macOS related to Obsidian, with thanks to @WilliamsJack. The steps are as follows:

  1. Open the Terminal application.
  2. cd ~/Library/Application\ Support/obsidian/
  3. Open the file "obsidian-1.5.3.asar" using a text editor like vim or any other editor of your choice.
  4. Locate the line that contains "".
  5. Comment out the line by adding a comment symbol (e.g., "")
  6. Save the changes and close the editor.
  7. Restart the Obsidian application.
MatanRubin commented 6 months ago

@stone-sail worked for me on macOS. Thanks!

RyotaUshio commented 6 months ago

Looks like this?

https://forum.obsidian.md/t/content-security-policy-header-in-obsidian-1-5-3-breaks-plugin/73889/2?u=ush

This is not a bug. For security reasons, themes(css) cannot load remote resources https://docs.obsidian.md/Themes/App+themes/Embed+fonts+and+images+in+your+theme 1. This is enforced in 1.5.x with that CSP header and we are not going to remove it.

cengizyu commented 6 months ago

"I wrote"* a shell and a Powershell script. You just have to run it in the right directory. I wasn't entirely comfortable taking over the .asar file from someone else 😅

It is sufficient to add blob: to the CSP header. The script does that. Alternatively, the line should be changed as follows: <meta http-equiv="Content-Security-Policy" content="style-src 'unsafe-inline' 'self' https://fonts.googleapis.com blob:">

First you have to install npm (google is your friend) and then install asar with npm install -g asar.

At least for me under Windows it made sense to reinstall Obsidian once over the old installation. Otherwise it loads the .asar file from another folder.

So the original is located under C:\Users\[UserName]\AppData\Local\Obsidian\resources

Copy the script to this folder and execute it.

The original .asar file remains as a backup and only blob: is added to the corrected one.

Unfortunately, I do not know where the files are located under Linux/Mac. However, I have tested the shell script under Linux and it does what it should.

Maybe someone else can tell me which paths are the right ones under Linux/Mac.

AddBlobToCSP.zip

  • ChatGTP is your friend 🥲

Solved it for me, thanks.

eugenekavalchuk commented 6 months ago

I have successfully solved this problem on macOS related to Obsidian, with thanks to @WilliamsJack. The steps are as follows:

  1. Open the Terminal application.
  2. cd ~/Library/Application\ Support/obsidian/
  3. Open the file "obsidian-1.5.3.asar" using a text editor like vim or any other editor of your choice.
  4. Locate the line that contains "".
  5. Comment out the line by adding a comment symbol (e.g., "")
  6. Save the changes and close the editor.
  7. Restart the Obsidian application.

What is 4 step?

aladmit commented 6 months ago

Damn, I don't see how to make a quick fix for that. In my understating plugin requires complete rewrite from scratch to remove fetching resources with blob 😞

atomwww commented 5 months ago

@stoweboyd NP obsidian-1.5.3.asar.zip

It worked in windows10 obsidian-1.5.3! Thank you.

PrithiPal commented 5 months ago

2. obsidian-1.5.3.asar.zip

I used the mentioned obsidian-1.5.2.asar.zip, removed old one, replace with above and restarted obsidian. Annotator properly render now, but content is empty

Screenshot

Screenshot 2024-01-03 at 11 15 03 PM

I tried following the steps mentioned here https://github.com/elias-sundqvist/obsidian-annotator/issues/356#issuecomment-1873227764 but can't seem to figure out after step 4.

Obsidian version 1.5.3 Annotator version 0.2.10 OS: macOS version 1.41

firstmover commented 5 months ago

I've solved this on Ubuntu with version 1.5.3

  1. Delete the old *.asar sudo rm -rf ~/.config/obsidian/obsidian-1.5.3.asar
  2. Unzip file and copy file to the config folder. obsidian-1.5.3.asar.zip sudo cp ~/Download/obsidian-1.5.3.asar ~/.config/obsidian/
  3. Then restart Obsidian

Thank you. This worked for my macOS. @BaoDoanUit

ErikSkansberg commented 5 months ago

Bit of a newb I tried to follow the steps provided by @RijoRoriz however when I looked into the Appdata folder I was not able to find the file obsidian-1.5.2.asar do we know if a patch to the annotator plug in will be coming out to fix this? image

I was able find the following file in the resources folder however when deleting it and restarting obsidian the issue still persists
image

elias-sundqvist commented 5 months ago

Damn, I don't see how to make a quick fix for that. In my understating plugin requires complete rewrite from scratch to remove fetching resources with blob 😞

Only css blobs are blocked, so the issue is not that big. I just need to ensure the styling is applied some other way. I can probably release a fix this weekend.