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

FediAct breaks Worldle #42

Closed
wlonkly opened this issue Dec 27, 2022 · 6 comments
Closed

FediAct breaks Worldle #42

wlonkly opened this issue Dec 27, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@wlonkly
Copy link
Contributor

wlonkly commented Dec 27, 2022

As of I think, v0.9.8 v0.9.8.5, FediAct has prevented some images from displaying on the country-guessing game Worldle in Firefox.

The symptoms are that the progress boxes when you make a guess do not load, and the country and flag vector images after the first one (on "guess neighbours", for instance).

Expected behavior:

Behavior with FediAct enabled:

I haven't been able to figure out exactly why, although I did observe this error in the console:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data | inject.min.js:1:22960

and inject.min.js is from Fediact. But I haven't been able to track down the connection.

Unfortunately since the interaction is occurring early, adding wordle.teuteuf.fr to the denylist in the extension does not solve the problem.

@wlonkly
Copy link
Contributor Author

wlonkly commented Dec 27, 2022

Confirmed that 0.9.7.1 did not have the issue, give me a moment and I'll find which release it started in.

@wlonkly
Copy link
Contributor Author

wlonkly commented Dec 27, 2022

The problem started in 0.9.8.5, Worldle still works correctly with 0.9.8.4.

@wlonkly
Copy link
Contributor Author

wlonkly commented Dec 27, 2022

Ah it's in here: https://github.com/Lartsch/FediAct/blob/v0.9.8.5/src/inject.js#L1462-L1468

I think it needs to trap an exception if https://<location>/api/v1/instance returns something that is not the expected Mastodon JSON. Looks like worldle.teuteuf.fr returns the game HTML at any URL path, including that one: https://worldle.teuteuf.fr/api/v1/instance

Or maybe it's enough to check content-type?

I'd work up a patch but I'm not set up for extension development and testing. (I still have no idea why it breaks Worldle in that specific way, either!)

@Lartsch
Copy link
Owner

Lartsch commented Dec 27, 2022

Hi there,
thanks for posting the issue and good job pointing it out! Yes, this check requires some additional processing. Seems like the endpoint is kinda popular and there would be too much false-positives ;)
If the check succeeds, some event listeners are set up to provide the functionality. I can imagine that these somehow mess with the website you mentioned, so improving the check should fix this issue too.
Will look into this tomorrow,
Cheers

@Lartsch Lartsch self-assigned this Dec 27, 2022
@Lartsch Lartsch added the bug Something isn't working label Dec 27, 2022
@Lartsch Lartsch moved this to In Progress in FediAct tracker Dec 27, 2022
@Lartsch
Copy link
Owner

Lartsch commented Dec 29, 2022

Should be fixed with 8926e8a / v0.9.8.6

@Lartsch Lartsch closed this as completed Dec 29, 2022
@github-project-automation github-project-automation bot moved this from In Progress to Done in FediAct tracker Dec 29, 2022
@wlonkly
Copy link
Contributor Author

wlonkly commented Dec 30, 2022

Unfortunately the problem is still happening in v0.9.8.7 in Worldle. The JSON error is gone now, but I guess that was a red herring, sorry!

I dug around a little bit more and I can't find the conflict between the site and this extension. One thing I did notice is that the images disappear the moment FediAct is enabled -- I don't have to reload for them to disappear.

The other thing I noticed is that if I disable opacity: 0 (from Worldle's .opacity-0 class in chunk.css) then the problem goes away. So for some reason, that opacity which is usually being overridden... somehow (probably during fade-in?) is still being applied when FediAct is enabled.

(Although I'm eyeing the @keyframes animations -- I don't have enough front-end skills to know if that would interfere though.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants