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

Linux support #2

Open
igalic opened this issue Aug 15, 2018 · 12 comments
Open

Linux support #2

igalic opened this issue Aug 15, 2018 · 12 comments

Comments

@igalic
Copy link

igalic commented Aug 15, 2018

Most Linux desktop-distros (pre)install Google's Noto Color Emoji

Perhaps it'd be more helpful to those to add Noto Color Emoji to the list of fonts, rather than outright rejecting Linux.

@slightlyfaulty
Copy link

🤦‍♂️

(From Linux 20 years in the future)

keithamus added a commit that referenced this issue Jul 16, 2020
Most Linux distributions come with support for Emoji by installing Noto. Adding fallback images can make things worse for linux users.
@kevincox
Copy link

kevincox commented Aug 9, 2021

We shouldn't be adjusting fonts that will override the user's default emoji choice anyways. It's 2021 and we are detecting support based on having Linux but not Android in your user agent string 😅

@kevincox
Copy link

kevincox commented Aug 9, 2021

I created a userscript to fix this on GitHub. I would be happy to accept patches for other sites, if any, that are using this component. https://userscripts.kevincox.ca/github-emoji-linux.user.js

@zidoshare
Copy link

same issue,fallback images are too ugly.

@jacobwhall
Copy link

This is bugging me so much! @keithamus tried to fix this with #26, and the PR was rejected because it was uncertain how many users would be affected. I like @igalic's idea of suppressing this behavior for clients with Noto Color Emoji installed, would that be possible?

@keithamus
Copy link
Member

We're unable to detect what fonts are installed. Perhaps one thing we could do is allow emojis for those with emoji explicitly listed in their UA, giving users at least some kind of workaround to enable emoji support:

-Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
+Mozilla/5.0 (X11; Linux x86_64; emoji; rv:92.0) Gecko/20100101 Firefox/92.0"

@ayosec
Copy link

ayosec commented Jun 13, 2022

Since 2016, Firefox includes its own font to support emojis, so there is no problem if the operating system does not support emojis.

I don't know about other browsers, but at least in Firefox the check allow using actual emojis, instead of the image fallbacks.

@mageddo
Copy link

mageddo commented Mar 5, 2023

I'm using Linux and have a custom emoji Library, it's labeled as Segoe UI Emoji so most sites even Github can use it, I can see my custom emoji working for 500 miliseconds then this script overrides it by a fallback image like:

<img class="emoji" alt="+1" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">

I realized that the cause for that probably is this snippet which consider Linux hasn't support for emojis? 🤔

const onLinux = /\bLinux\b/.test(navigator.userAgent) && !/\bAndroid\b/.test(navigator.userAgent)

I think it would be great if you check if the wanted font family like "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol", etc are installed before fallback it, use the fallback based on the running OS is a pretty weak check.

Maybe this topic can help you about check if a font is installed on the browser

@kevincox
Copy link

kevincox commented Mar 5, 2023

Please don't check for any specific font families. Users should be able to use whichever emoji font they want. Not some pre-approved whitelist that will be backed into software and probably not updated for decades.

@mageddo
Copy link

mageddo commented Mar 5, 2023

@kevincox

I created a userscript to fix this on GitHub. I would be happy to accept patches for other sites, if any, that are using this component. https://userscripts.kevincox.ca/github-emoji-linux.user.js

Thanks for sharing this, it didn't work for me at first because of this, then I fixed it and it's working now 😄

the script version I'm using, if you wan't to check it out.

As you can see below, my emojis aren't the Github default ones anymore
image

@kevincox
Copy link

kevincox commented Mar 5, 2023

Thanks for pointing that out. I've made a change that I think should make it work on Tampermonkey without requesting all permissions. If further discussions are needed we can do that here: https://gitlab.com/kevincox/userscripts/-/issues/1

@ayosec
Copy link

ayosec commented Mar 5, 2023

For people using uBlock Origin (1.46.0 or newer), you can fix the issue with the following filter:

github.com##g-emoji:remove-attr(fallback-src)

It removes the fallback-src attribute, which is required to replace the emojis with the images.

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

Successfully merging a pull request may close this issue.

8 participants