跳到主要内容
Format Link

Format Link EN

Hiroaki Nakamura · Firefox

Format a link and copy it to the clipboard in your favorite format. You can use keyboard shortcuts, the toolbar button, or context menus to copy a link. You can escape meta characters, for example ] (closing square bracket) in markdown title.

4.4/5 40 人评分 857用户 v5.5.2当前版本

简介

How to use

You can use keyboard shortcuts, context menus, or the toolbar button of Format Link extension
to copy a link in the specified format. Before doing that, you can optionally select some text
which may or may not contain a link.

keyboard shortcut
The keyboard shortcut for "Copy a link in the default format" is shortcut for clicking the
toolbar button. The link is copied in the default format and the popup is shown under
the toolbar button.

Also there are shortcuts for copying in the link in the corresponding format regardless of
the default format.

See Manage extension shortcuts in Firefox | Firefox Help for showing and changing keyboard shortcuts.

context menu
Open the context menu and select the "Format Link as XXX" menu item.
"XXX" in the menu item label changes as you change the default format by clicking the "Set as default" button in the popup page for the toolbar button.

If you check the "Create submenus" in the options page and save the options,
submenus for each format are created under the "Format Link" context menu group.

toolbar button
When you press the toolbar button of "Format Link", the link is copied in the default format,
the popup page becomes open, and the formatted text is shown in the text area.

If you want to copy the link in different format, you can press one of the radio buttons.

Also if you want to change the default format, you can press the "Set as default" button.

Flexible settings
You can modify formats in [Tools] -> [Extensions] -> Clik "Options" link in "Format Link" Extension. In format settings, you can use the mini template language.

variable reference: {{variable}}

  • {{variable}}
    • variable = title / url / page_url / text / selected_text
    • The value of variable title is the HTML page title.
    • The value of variable text is:
      • the selected text if some text is selected,
      • the link text if you open the context menu over a link,
      • the page title otherwise.
    • The value of variable selected_text is
      • the selected text if some text is selected,
      • empty string if no text is selected.
    • The value of the variable url is the link if you open the context menu over a link,
      the first link if selection contains a link, or the HTML page URL otherwise.
    • The value of the variable page_url is always the HTML page URL.
    • No spaces are allowed between variable name and braces.
  • {{variable.s("foo","bar")}}
    • Which means variable.replace(new RegExp("foo", 'g'), "bar")
    • You can use escape character \ in strings.
    • You must escape the first argument for string and regexp.
      For example, .s("\\[","\\[") means replacing \[ with \\[
    • You can chain multiple .s("foo","bar")
  • {{variable.urlencode()}}
    • Which means encodeURIComponent(variable)
  • You can use the escape character \ in strings. For example, you need to escape \ with \ like \\,
    and also you need to escape { with \ like \{. See the LaTeX example below.
  • Other characters are treated as literal strings.

Examples:

Markdown

[{{text.s("\\[","\\[").s("\\]","\\]")}}]({{url.s("\\)","%29")}})

reST

{{text}} <{{url}}>`_

HTML

<a href="{{url.s("\"",""")}}">{{text.s("<","&lt;")}}</a>

HTML with selected text

<a href="{{page_url.s("\"",""")}}#:~:text={{selected_text.urlencode()}}">{{title.s("<","<")}}</a>

Text

{{text}}\n{{url}}

LaTeX

\\href\{{{url}}\}\{{{text}}\}

Redmine Texitile

"{{title.s("\"","&quot;").s("\\[","&#91;")}}":{{url}}

KNOWN LIMITATIONS

Due to security reason, you cannot copy the URL on some pages like addons.mozilla.org. See Content scripts - Mozilla | MDN for details.

Format Link 是做什么的

Format Link 是一款面向 Firefox 的外观主题类扩展,主要用来更换浏览器配色、给网页加深色模式、调整界面观感。官方对它的介绍是:Format a link and copy it to the clipboard in your favorite format. You can use keyboard shortcuts, the toolbar button, or context menus to copy a link. You can escape meta characters, for example ] (closing square bracket) in markdown title.在Firefox 附加组件商店(AMO)上,它当前版本 5.5.2,评分 4.35(40 人评价),约 857 名用户。

适合什么人用

从功能定位看,Format Link 更适合长时间对着屏幕、希望降低眼睛负担的用户。如果你平时只是偶尔遇到相关需求,用浏览器自带功能也能凑合;但如果这件事每天都发生,装一个专门处理它的扩展通常比手动操作省事得多。

怎么安装 Format Link

  1. 打开Firefox 附加组件商店(AMO)上的官方页面;
  2. 点「添加到浏览器」并确认权限提示;
  3. 装好后在扩展列表里固定图标,方便随时开关。

本站只做索引与介绍,安装包来自官方商店。如果商店页面提示当前地区不可用,说明该扩展未在你所在区域上架。

常见问题

Format Link 是免费的吗?

Format Link 在Firefox 附加组件商店(AMO)免费提供下载。它是浏览器扩展,装上就能直接用,不需要注册账号。

Format Link 安全吗?

它只申请了 0 项权限,范围比较克制,没有申请「读取所有网站数据」这种大权限。

Format Link 支持哪些浏览器?

当前收录的版本来自Firefox 附加组件商店(AMO),适用于 Firefox。同一个扩展在其他商店可能有对应版本,但功能与版本号不一定相同。

怎么卸载 Format Link?

在扩展管理页找到 Format Link,点移除即可。它在本地保存的设置会一起清掉,不会残留数据。

权限清单 来自 manifest.json 原文

未解析到权限条目。