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

MPIV isn't properly showing up on a Mastodon web client anymore #113

Open
em-ex opened this issue Jan 23, 2024 · 4 comments
Open

MPIV isn't properly showing up on a Mastodon web client anymore #113

em-ex opened this issue Jan 23, 2024 · 4 comments

Comments

@em-ex
Copy link

em-ex commented Jan 23, 2024

The default Mastodon web client update 4.2.x brought this strange issue where MPIV's viewer box is being rendered way below viewport.

Steps to reproduce the bug

  1. Open a Mastodon instance web client, for example this random post
  2. Hover over a photo
  3. No MPIV viewer is visible but th e vertical scrollbar jumps, proving that the MPIV is functioning. If you keep zooming in, just the upper third of the viewer will appear on the bottom of the screen, while the remaining two thirds will still be hidden somewhere below the viewport.

Expected behavior

MPIV opens its viewer in the middle of the viewport

Environment

  • Browser: Firefox 121.0.1 + Tampermonkey 5.0.1
  • MPIV Version: 1.2.34

I'd really appreciate any advice on how to debug this. Thank you

@tophf
Copy link
Owner

tophf commented Jan 23, 2024

The site unusually forbids inline style attribute via CSP header. I'll try to come up with a workaround.

@em-ex
Copy link
Author

em-ex commented Jan 23, 2024

Thanks for the quick response!
This is strange about the CSP as my custom Stylus rules are being applied and MPIV is being injected into the page DOM.
I'd expect those not to work at all if CSP was the culprit.
Am I missing something?

@tophf
Copy link
Owner

tophf commented Jan 23, 2024

The CSP error for mpiv's style attribute is shown in devtools console. Stylus doesn't use inline style attribute. As a workaround you can try adding a different @sandbox mode.

@em-ex
Copy link
Author

em-ex commented Jan 23, 2024

I can confirm: adding // @sandbox JavaScript to the script code does solve the issue.
Suitable as a workaround, but would love to see if it can be solved without monkey-patching.
Thank you once again!

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

No branches or pull requests

2 participants