obahareth / notion-rtl

ARCHIVED - A Chrome extension to enable RTL support in https://notion.so
https://chrome.google.com/webstore/detail/notion-rtl/fflggojmgaedcocmholcdicoedgaabib
MIT License
60 stars 8 forks source link

Extension not Working due to a Warning on Attribute Mutations #28

Open uriklar opened 2 years ago

uriklar commented 2 years ago

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!

Fahme commented 2 years ago

can you confirm if its working on these pages ?

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

obahareth commented 2 years ago

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.

Fahme commented 2 years ago

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

obahareth commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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.

Fahme commented 2 years ago

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

AhmedMub commented 2 years ago

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 commented 2 years ago

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

Fahme commented 2 years ago

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 commented 2 years ago

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

AhmedMub commented 2 years ago

No, I don't @Fahme

Fahme commented 2 years ago

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 !

AhmedMub commented 2 years ago

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

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

Fahme commented 2 years ago

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 ?

jrykner commented 2 years ago

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

obahareth commented 2 years ago

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.

jrykner commented 2 years ago

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: @.***>

Fahme commented 2 years ago

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 commented 2 years ago

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 ?

obahareth commented 2 years ago

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.

Fahme commented 2 years ago

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.

dragonwocky commented 2 years ago

@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

jrykner commented 2 years ago

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: @.***>

obahareth commented 2 years ago

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

justjake commented 2 years ago

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.

jrykner commented 2 years ago

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: @.***>

obahareth commented 2 years ago

Thank you so much @justjake!

SajadJalilian commented 2 years ago

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

Fahme commented 2 years ago

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

justjake commented 2 years ago

The dir attribute should be writable again! You can verify on any Notion account that can text select in multiple blocks.

These changes are related to this recent product announcement: https://twitter.com/notionhq/status/1483884489235255297?s=21

dragonwocky commented 2 years ago

Thanks so much @justjake, it's good to know Notion is willing to make allowances for things like this.

FekketCantenel commented 2 years ago

Today I started getting Reverting mutation of attribute class errors because I have a script that watches for mutations and adds CSS classes to certain elements, which in turn allows me to style them. I hope that either class is made writable, or a workaround is found.

dragonwocky commented 2 years ago

@justjake this has also begun blocking a few of the features of the notion-enhancer (e.g. the simpler databases feature, which lets users hide parts of inline databases and rename linked databases). Is there anything we could do about that?

Both as a user and as the dev of a 3rd-party enhancement for Notion, it'd be ideal to have some of the notion-enhancer's features builtin to Notion, but until they are it'd really be appreciated if the use/creation of these improvements to the client UI/UX wasn't being blocked.