mobilemind / fyi-bookmarklets

bookmarklets to easily create an email from browser with page title, url & selected text

Home Page:https://mobilemind.github.io/fyi-bookmarklets/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work in Chrome 59.0.3071.109

e-orlov opened this issue · comments

Independently of whether you put an email into the alert's field or not after submitting the alert's form the window of Outlook with always same content opens, like on screenshot

Thank you for raising the issue. I haven't used this on Chrome in years, but I'll try it.

Let me looking this over the next day or two. I'll follow-up here.

Looks like there were a few underlying issues to address (or anticipate).

  1. Differences in Windows vs Linux/macOS line-endings (<CR><LF> pairs vs <LF>, or in alternate syntax: \r\n vs \n)
  2. A few percent-encoding url encoding issues [Example: JavaScript addition/concatenation operator ("+") decoding as a blank space (" ")].
  3. Chrome 61 and later blocks resources whose URLs contain both \n and < characters https://www.chromestatus.com/features/5735596811091968. I tried to work-around it, but that may become an issue in the future.

I re-wrote the WebKit version of fyi-bookmarklet using ECMAscript 6, and hand-encoded the URL.

I tested it successfully on macOS with:

  • Browser: Chrome 59.0.3071.11, Email: Thunderbird 52.2.1
  • Browser: Safari 10.1.1, Email: Thunderbird 52.2.1

Can you please try the bookmarklet URL shown below with your configuration?

javascript:(()=>{let n='';const r='%250D%250A',e=encodeURIComponent(document.title),o=window.getSelection();''!==(n=window.prompt('Send link to email address(es):','user@domain.tld'))&&(location.href=`mailto:${n}?subject=fyi:${e}&body=${e}${r}${location.href}${r}---${r}${encodeURIComponent(o)}${r}${r}`)})();void'2.9.0wk'

Let me know if it works. Then I can figure out how I might re-do the build process to automate things.

Thanks.

Updated code & README. I believe this is fixed as of release 2.9.0 and commit 571c433

Let me know if there is still an issue here.