Misskey に URL を共有するブックマークレット

2023-11-24

#Misskey

#JavaScript

手軽に URL を共有できるように

Overview

自鯖 Mi.seanut に簡単に URL を共有するノートを投稿できるブックマークの作り方
ドメイン部分(mi.seanut.app)を変更すれば、どの Misskey でも利用できる

PC/スマートフォンのどちらでも利用可

HowTo

通常版

  1. 以下のテキストを全てコピーし、任意のブラウザにてブックマークの URL に登録
    (ブックマーク名は任意)

    javascript: (function () {
      var w = 600,
        h = 400;
      window.open(
        "https://mi.seanut.app/share?text=" +
          encodeURIComponent(document.title) +
          " " +
          encodeURIComponent(location.href),
        "_blank",
        "width=" +
          w +
          ",height=" +
          h +
          ",left=" +
          ((screen.width - w) / 2) * 3 +
          ",top=" +
          ((screen.height - h) / 2) * 3 +
          ",scrollbars=yes,resizable=yes,toolbar=no,location=yes",
      );
    })();
  2. 共有したいページを開いた状態で、作成したブックマークを選択

  3. ページのタイトルと URL が入力された状態で、共有ウィンドウが開く

  4. 自由に追記して、投稿!

引用版(nyaize 対応)

猫モード中は、な が にゃ に変換されてしまうので、引用文としてリンクを表示する

javascript: (function () {
  var w = 600,
    h = 400;
  window.open(
    "https://mi.seanut.app/share?text=" +
      "> " +
      encodeURIComponent(document.title) +
      " " +
      encodeURIComponent(location.href),
    "_blank",
    "width=" +
      w +
      ",height=" +
      h +
      ",left=" +
      ((screen.width - w) / 2) * 3 +
      ",top=" +
      ((screen.height - h) / 2) * 3 +
      ",scrollbars=yes,resizable=yes,toolbar=no,location=yes",
  );
})();

Source