SeeStack

Add titles to Substack redirect links in Gmail, exposing the target URL

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
Kevin Shay
日安装量
0
总安装量
6
评分
0 0 0
版本
0.12
创建于
2023-11-22
更新于
2023-12-05
大小
3.9 KB
许可证
暂无
适用于

Newsletters sent via Substack often contain links added by the author. The links in the email go to a redirect service on the Substack site. Click them and you’ll arrive at the intended page, but there’s no way to tell, by mousing over these opaque URLs, where you’ll end up or what site the author linked to.

This script tries to address this, at least when you’re reading newsletters in Gmail on a desktop web browser. It looks for Substack redirect links within a message, tries to determine where each one redirects to, and adds a title tag to the link containing the destination URL, which will appear as a tooltip when you hover the mouse cursor over the link. It does not modify the link URL itself; the intention is not to circumvent Substack’s tracking, but simply to provide some transparency into where the links lead.

This initial version has a few caveats.

  • First of all, it currently needs to work (see code comment for details) by handling errors when fetching the redirect URLs, so you’ll see errors if you happen to have the browser’s console open. (Gmail itself tends to throw lots of errors in there too!)
  • Also, it uses a simple delay to try to wait until the email has been loaded; this can certainly be improved.
  • Finally, it would be preferable to inspect each link only when you hover over it rather than all at once, but trying to do it this way seemed to provide a worse user experience (see code for details).

Bug reports and feature requests are welcome. I’ll put the script on GitHub if there’s any interest.