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

Extension breaks when certain emojis in title. #4

Open
Paris-Man opened this issue Oct 20, 2022 · 2 comments
Open

Extension breaks when certain emojis in title. #4

Paris-Man opened this issue Oct 20, 2022 · 2 comments

Comments

@Paris-Man
Copy link

Clicking the save link button does nothing with certain emojis in a tab's title. For example, when they are in a Twitter user's handle.

image

Getting rid of tab.title in in filename in generate_link.js fixes it. But I guess then you have to name files manually.

@nbeaver
Copy link
Owner

nbeaver commented Oct 20, 2022

Hi @Paris-Man, I'm having some difficulty reproducing this. The @hourlyfish Twitter account is gone, and the Emojipedia homepage works fine for me:

link-to-📙_Emojipedia_—_😃_Home_of_Emoji_Meanings_💁👌🎍😍_emojipedia.org.link.html

As does the page for recent emoji like heart hands:

link-to-🫶_Heart_Hands_Emoji_emojipedia.org.link.html

I'm using Firefox 105.0 on Ubuntu 18.04 if that matters.

@nbeaver
Copy link
Owner

nbeaver commented Nov 13, 2022

The @hourlyfish Twitter account is back, but no emojis in the title. However, I think this may have been due to a zero-width joiner in the page title, e.g. here:

https://emojipedia.org/man-farmer/

Trying to run downloads.download() on a filename containing a ZWJ results in a failed download and an "Error: filename must not contain illegal characters" message.

I've added a fix to strip out the ZWJ and I'll post a new version shortly, but there are probably other page titles that will fail to sanitize. Only the browser truly knows what characters are illegal, but the WebExtensions API doesn't provide access to the browser's filename sanitize function, so I don't know of a robust way to fix this in the general case.

Related:

solorey/Art-Saver#18

eight04/image-picka#208

https://bugzilla.mozilla.org/show_bug.cgi?id=1791530

https://stackoverflow.com/questions/73036830/sanitise-unicode-pair-for-filename-in-javascript

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