notion-rtl icon indicating copy to clipboard operation
notion-rtl copied to clipboard

Extension not Working due to a Warning on Attribute Mutations

Open uriklar opened this issue 3 years ago • 34 comments

Hi @obahareth and thanks for the great extension! Right now the extension isn't working for me and i'm getting a lot of these errors in the console

NOTION WARNING  Reverting mutation of attribute dir from "null" -> "auto" in component

I tried copying the components but they have circular json so here's a screenshot if this means anything to you image image

I'm on the latest version of Chrome (96.0.4664.93)

Let me know if there's anything I can help with/debug/etc... Or maybe just point me in the right direction. Thanks alot!

uriklar avatar Dec 13 '21 08:12 uriklar

can you confirm if its working on these pages ?

https://www.notion.so/Pages-f2cfdcc28e074a04b40bed5fea7ba4d5

Fahme avatar Dec 13 '21 08:12 Fahme

chrome_nbo9NGjA8F

This is the script link that triggers the warning: https://www.notion.so/711-17b0a195537095b60ea5.js

We might have to go back to a polling approach.

obahareth avatar Dec 20 '21 19:12 obahareth

I'll try to reproduce the bug if i couldn't i'll just revert the changes

Fahme avatar Dec 20 '21 20:12 Fahme

Actually, I don't think even that will work. It seems like Notion has introduced a mechansim to guard pages from being modified. I just tried doing this in the console and Notion blocked it. chrome_tzM90DikjM

obahareth avatar Dec 20 '21 20:12 obahareth

I also tried reaching out to Notion here while we figure out a way to get this to work: https://twitter.com/o_bahareth/status/1473023355762708482?s=20

This seems like a security layer they added, whatever we do to fix the issue, I want to make sure we don't mess with that layer, it wouldn't be helpful to users to have notion-rtl be a security tradeoff.

I'll experiment more on what we can do with CSS perhaps?

obahareth avatar Dec 20 '21 20:12 obahareth

@Fahme Perhaps if you do a hard reset of your cache and everything, Notion might start serving this new script to you.

I honestly hope this is an indicator that they will natively support RTL and not JUST a security enhancement.

obahareth avatar Dec 20 '21 20:12 obahareth

Alright i'll see what i can do, keep me posted if you found a workaround and i'll follow the tweets as well

Fahme avatar Dec 20 '21 20:12 Fahme

I tested the extension on fresh installed chrome and it worked just fine with no errors or warnings, that goes for any other browser using chrome extensions like brave(tested).

image

AhmedMub avatar Dec 20 '21 23:12 AhmedMub

But after login to notion, the extension stopped working showing the mentioned warnings, that's happening also after hard resetting the cache and everything.

AhmedMub avatar Dec 20 '21 23:12 AhmedMub

But after login to notion, the extension stopped working showing the mentioned warnings, that's happening also after hard resetting the cache and everything.

I've tried incognito mode and it worked fine for me in both cases of a logged account or not, not very sure on what's the problem yet.

it could be a device/network issue, gotta dig some more. Hopefully the notion team will reply soon.

cc. @obahareth

Fahme avatar Dec 21 '21 13:12 Fahme

@AhmedMub do you use any other notion plugins in your browser ???

Fahme avatar Dec 21 '21 14:12 Fahme

No, I don't @Fahme

AhmedMub avatar Dec 21 '21 18:12 AhmedMub

Make minor fixes to remove warning #30

Alright, if you can help us test this PR https://github.com/obahareth/notion-rtl/pull/30 that would be cool !

Fahme avatar Dec 21 '21 18:12 Fahme

Notion RTL got back to work perfectly with no warnings or errors.

Thank you @Fahme @obahareth very much for your amazing support.❤️

AhmedMub avatar Dec 22 '21 07:12 AhmedMub

Notion RTL got back to work perfectly with no warnings or errors.

Thank you @Fahme @obahareth very much for your amazing support.❤️

No problem, just to make sure did you use the PR mentioned in the issue, or did it work by itself ?

Fahme avatar Dec 22 '21 10:12 Fahme

RTL has stopped functioning on notion enhancer, I tried turning it on and off, doesn't work anything possible to fix it?

jrykner avatar Dec 22 '21 13:12 jrykner

From my understanding of the issue, it looks like Notion are testing something that prevents any third party script from mutating the DOM.

It doesn't appear to be fully rolled out yet. As I shared in a previous comment, just attempting to modify the DOM even without an extension was being blocked and the change was reverted by a script in Notion itself.

Once they probably roll this mechanism in full, the extension will probably stop working everywhere. We still need to find other ways to make this work.

obahareth avatar Dec 22 '21 14:12 obahareth

Interesting Thanks for the quick reply I do need to emphasize that as notion enhancer recommended I didn’t download any updates desktop version so I’m still using an old one that at least a year old or so on my Mac So the issue must be on their server not on the desktop app itself On 22 Dec 2021, 16:07 +0200, Omar Bahareth @.***>, wrote:

From my understanding of the issue, it looks like Notion are testing something that prevents any third party script from mutating the DOM. It doesn't appear to be fully rolled out yet. As I shared in a previous comment, just attempting to modify the DOM even without an extension was being blocked and the change was reverted by a script in Notion itself. Once they probably roll this mechanism in full, the extension will probably stop working everywhere. We still need to find other ways to make this work. — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

jrykner avatar Dec 22 '21 14:12 jrykner

From my understanding of the issue, it looks like Notion are testing something that prevents any third party script from mutating the DOM.

It doesn't appear to be fully rolled out yet. As I shared in a previous comment, just attempting to modify the DOM even without an extension was being blocked and the change was reverted by a script in Notion itself.

Once they probably roll this mechanism in full, the extension will probably stop working everywhere. We still need to find other ways to make this work.

It's working for you now ?? @obahareth

Fahme avatar Dec 22 '21 15:12 Fahme

Interesting Thanks for the quick reply I do need to emphasize that as notion enhancer recommended I didn’t download any updates desktop version so I’m still using an old one that at least a year old or so on my Mac So the issue must be on their server not on the desktop app itself

we don't support notion-enhancer on this repo or if @dragonwocky would like to help out here not sure ?

Fahme avatar Dec 22 '21 15:12 Fahme

From my understanding of the issue, it looks like Notion are testing something that prevents any third party script from mutating the DOM. It doesn't appear to be fully rolled out yet. As I shared in a previous comment, just attempting to modify the DOM even without an extension was being blocked and the change was reverted by a script in Notion itself. Once they probably roll this mechanism in full, the extension will probably stop working everywhere. We still need to find other ways to make this work.

It's working for you now ?? @obahareth

Yes it's working for me now @Fahme.

obahareth avatar Dec 22 '21 15:12 obahareth

I think we might need to remove from readme the "not working" part and add that the extension is not stable by pointing to this issue or add a new one. So that we can avoid issues pilling up in future in case it's not working anymore.

Fahme avatar Dec 22 '21 16:12 Fahme

@jrykner the notion-enhancer RTL is known to be broken in the enhancer for other reasons as well, you can track the issue here: https://github.com/notion-enhancer/desktop/issues/589

an update that includes a fix for it is work-in-progress.

@obahareth this script looks problematic for all notion enhancements/extensions in general, and probably isn't indicative of them adding their own support for stuff :(

it seems less of a helpful security layer and more of a restrictive layer -- it will equally block wanted & unwanted modifications

edit: the notion-enhancer has been released on the chrome store with a working version of right-to-left

dragonwocky avatar Dec 22 '21 22:12 dragonwocky

Yes indeed it is not working at all with the new version no with chrome extension and not on desktop Looking forward to getting back RTL asap Thx On 2 Jan 2022, 17:28 +0200, Ahmed Mubarak @.***>, wrote:

Please @Fahme is there any updates or fix for Notion RTL as It's not working at all since their latest update 10 days ago and all my documents got ruined — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

jrykner avatar Jan 03 '22 08:01 jrykner

I am reopening this issue because it seems like Notion reenabled this blocking feature again.

obahareth avatar Jan 16 '22 10:01 obahareth

Hello, I'm an engineer at Notion. We're currently rolling out some changes to the Notion editor to a portion of users, which is probably why this issue presents inconsistently for different people, or for different devices. Eventually we expect this behavior to be active for all users.

I'm sorry these changes broke your extension. I'll add an exception to allow mutation of the dir attribute soon.

justjake avatar Jan 18 '22 19:01 justjake

That would be great Until you offer RTL natively on notion we really need a solution for day to day usage in RTL languages Thanks On 18 Jan 2022, 21:52 +0200, Jake Teton-Landis @.***>, wrote:

Hello, I'm an engineer at Notion. We're currently rolling out some changes to the Notion editor to a portion of users, which is probably why this issue presents inconsistently for different people, or for different devices. Eventually we expect this behavior to be active for all users. To resolve for your use-case, I can allow mutation of the dir attribute. — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

jrykner avatar Jan 18 '22 20:01 jrykner

Thank you so much @justjake!

obahareth avatar Jan 18 '22 20:01 obahareth

As last resort; I'm using the stylish extension with a script that is changing CSS. Maybe you can add this functionality for users who are not familiar with stylish Strylish script

SajadJalilian avatar Jan 19 '22 12:01 SajadJalilian

As last resort; I'm using the stylish extension with a script that is changing CSS. Maybe you can add this functionality for users who are not familiar with stylish Strylish script

I've thought about it before but i don't think it gives the same experience when reading text.

with dir="auto" Screen Shot 2022-01-19 at 2 17 30 PM

With css direction: rtl Screen Shot 2022-01-19 at 2 17 36 PM

Fahme avatar Jan 19 '22 12:01 Fahme