Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rikaikun doesn't work in Google Docs for some users (TrustedScript violation?) #881

Closed
melink14 opened this issue Mar 1, 2022 · 3 comments · Fixed by #962
Closed

Rikaikun doesn't work in Google Docs for some users (TrustedScript violation?) #881

melink14 opened this issue Mar 1, 2022 · 3 comments · Fixed by #962
Assignees

Comments

@melink14
Copy link
Owner

melink14 commented Mar 1, 2022

From the support tab:

When I bring up developer tools the error messages are "VM290:27 This document requires 'TrustedScript' assignment." and "Trusted Type expected, but String received"

Maybe we can created a TrustedScript but policy creation can also be hardened...

Can check if google docs is running trusted types experiment...

refs:
https://web.dev/trusted-types/

@melink14 melink14 added the bug label Mar 1, 2022
@melink14
Copy link
Owner Author

melink14 commented Mar 1, 2022

Unfortunately, trusted types error was not the cause of the problem as confirmed by using ModHeader to force enforcement.

My best guess now is some kind of bad interaction between extensions since by default Google Docs should have no such errors.

@melink14
Copy link
Owner Author

melink14 commented Apr 7, 2022

Based on another thread on Twitter with this same error plus some other font 404s I'm starting to think that it might be a race condition when rikaikun runs too fast and sets isGoogleDoc to false.

@melink14 melink14 self-assigned this Apr 7, 2022
melink14 added a commit that referenced this issue Apr 7, 2022
I found in offline mode I the cached Google Docs query selector was always false due to executing before page loaded. I now query the selector on every `mousemove` which seems fast enough. An improvement would be to memoize a function or perhaps add a on Dom loaded callback.
I also removed the check for if the target was `svg` or `rect` since there's at least one counter example to that assumption. For now let's avoid premature optimization.

I also had to update the tests to not overwrite the Google Docs class since it now needs to be present at each execution.

Fixes #897
Fixes #881
melink14 added a commit that referenced this issue Apr 7, 2022
I found in offline mode I the cached Google Docs query selector was always false due to executing before page loaded. I now query the selector on every `mousemove` which seems fast enough. An improvement would be to memoize a function or perhaps add a on Dom loaded callback.
I also removed the check for if the target was `svg` or `rect` since there's at least one counter example to that assumption. For now let's avoid premature optimization.

I also had to update the tests to not overwrite the Google Docs class since it now needs to be present at each execution.

Fixes #897
Fixes #881
melink14 pushed a commit that referenced this issue Apr 7, 2022
### [2.3.2](v2.3.1...v2.3.2) (2022-04-07)

### Bug Fixes

* **ui:** Make Google Doc Canvas checks more lenient ([#962](#962)) ([6809154](6809154)), closes [#897](#897) [#881](#881)
* **ui:** Reset styles on the light dom container ([#960](#960)) ([e734a35](e734a35)), closes [#959](#959)
@melink14
Copy link
Owner Author

melink14 commented Apr 7, 2022

🎉 This issue has been resolved in version 2.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant