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

Bug caught: On some subpages of medium addon doesn't work #11

Open
sirpeas opened this issue May 5, 2019 · 2 comments
Open

Bug caught: On some subpages of medium addon doesn't work #11

sirpeas opened this issue May 5, 2019 · 2 comments

Comments

@sirpeas
Copy link

sirpeas commented May 5, 2019

  • Browser: Checked on Webkit (Chrome + Brave)
  • Operating System: OSX & Windows 10
  • URL of the problem page:

No screenshot needed.

How to fix:
From my observation those sites have gr__medium_com class in a <html> tag so we can simply add in js/content.js:11:

...
HTML_MEDIUM_CLASS = /gr__medium_com/
...

and then
js/content.js:63;64

if (IS_MEDIUM.test(document.head.getAttribute("prefix"))
    || HTML_MEDIUM_CLASS.test(document.getElementsByTagName('html')[0].className)) {

and we're done but then there is another issue. Styles are not applied, because those sites has got way different class names than "normal" ones.

@Mottie
Copy link
Owner

Mottie commented May 5, 2019

Hi @sirpeas!

This is related to issue #10 (dealing with the profile pages), which essentially has the same problem.

I'm not seeing the gr__medium_com class name on the <html> tag; but with a few modifications to the usercss I shared in issue #10, we can get it working for those topic pages:

Edit: Moved CSS into repo as a file.

I wasn't planning on modifying the extension to include the above css, since it's mostly generic and I don't know if/when the specific selectors will change. I wish Medium would use the same css framework that they use for the main story pages, but I'm starting to doubt that'll ever happen.


Install profile & topics usercss using this button:

Install the extras usercss

Mottie added a commit that referenced this issue May 5, 2019
@sirpeas
Copy link
Author

sirpeas commented May 6, 2019

Ahh, then it's some of my extension adding that class 🤷‍♂.
@Mottie I just send a ticket to ask, if they can make it more generic. It might be a big request but who knows 😄I will send their reply here

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

No branches or pull requests

2 participants