Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

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

Open
uriklar opened this issue Dec 13, 2021 · 34 comments
Open

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

uriklar opened this issue Dec 13, 2021 · 34 comments
Labels
bug Something isn't working

Comments

@uriklar
Copy link

uriklar commented Dec 13, 2021

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
Copy link
Collaborator

Fahme commented Dec 13, 2021

can you confirm if its working on these pages ?

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

@obahareth
Copy link
Owner

obahareth commented Dec 20, 2021

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
Copy link
Collaborator

Fahme commented Dec 20, 2021

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

@obahareth
Copy link
Owner

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
Copy link
Owner

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 obahareth added the bug Something isn't working label Dec 20, 2021
@obahareth obahareth changed the title NOTION WARNING Reverting mutation of attribute dir from "null" -> "auto" in component Extension not Working due to a Warning on Attribute Mutations Dec 20, 2021
@obahareth obahareth pinned this issue Dec 20, 2021
@obahareth
Copy link
Owner

@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
Copy link
Collaborator

Fahme commented Dec 20, 2021

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
Copy link

AhmedMub commented Dec 20, 2021

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
Copy link

AhmedMub commented Dec 20, 2021

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
Copy link
Collaborator

Fahme commented Dec 21, 2021

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
Copy link
Collaborator

Fahme commented Dec 21, 2021

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

@AhmedMub
Copy link

No, I don't @Fahme

@Fahme
Copy link
Collaborator

Fahme commented Dec 21, 2021

Make minor fixes to remove warning #30

Alright, if you can help us test this PR #30 that would be cool !

@AhmedMub
Copy link

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

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

@Fahme
Copy link
Collaborator

Fahme commented Dec 22, 2021

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
Copy link

jrykner commented Dec 22, 2021

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

@obahareth
Copy link
Owner

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
Copy link

jrykner commented Dec 22, 2021 via email

@Fahme
Copy link
Collaborator

Fahme commented Dec 22, 2021

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
Copy link
Collaborator

Fahme commented Dec 22, 2021

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
Copy link
Owner

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
Copy link
Collaborator

Fahme commented Dec 22, 2021

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 Fahme closed this as completed Dec 22, 2021
@dragonwocky
Copy link
Contributor

dragonwocky commented Dec 22, 2021

@jrykner the notion-enhancer RTL is known to be broken in the enhancer for other reasons as well, you can track the issue here: notion-enhancer/notion-enhancer#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
Copy link

jrykner commented Jan 3, 2022 via email

@obahareth
Copy link
Owner

obahareth commented Jan 16, 2022

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

@obahareth obahareth reopened this Jan 16, 2022
@justjake
Copy link

justjake commented Jan 18, 2022

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
Copy link

jrykner commented Jan 18, 2022 via email

@obahareth
Copy link
Owner

Thank you so much @justjake!

@SajadJalilian
Copy link

SajadJalilian commented Jan 19, 2022

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
Copy link
Collaborator

Fahme commented Jan 19, 2022

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
Copy link

justjake commented Jan 20, 2022

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
Copy link
Contributor

dragonwocky commented Jan 21, 2022

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

@FekketCantenel
Copy link

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
Copy link
Contributor

dragonwocky commented Feb 5, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants