Mouse dictionary helper

Mouse Dictionary で引いた結果をAnkiwebのdeckに登録する君

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Autor
ozero
Dnevne instalacije
0
Ukupnih instalacija
16
Ocjene
0 0 0
Verzija
0.4
Stvoreno
07.07.2021.
Ažurirano
09.07.2021.
Size
4,59 KB
Licenza
N/A
Primjenjuje se
Sve stranice

Mouse Dictionary で引いた結果をAnkiwebのdeckに登録する君

英単語の意味だけ調べて済ませてたか、手作業で辞書から単語帳にコピペしてた人へ。辞書で引いた内容を即Ankiwebの単語帳に登録できます。

  1. Mouse dictinaryで単語の意味を表示する
  2. Mouse dictinaryウィンドウをクリック
  3. Ankiwebの単語登録画面が開いて、入力欄にさっき調べてた単語&意味が自動入力される
  4. あとは自動入力の内容を確かめて、Saveクリックして閉じる

なお↑の 2. で Ctrl + クリック したら、自動入力に加えて「自動保存&Ankiwebのタブ自動クローズ」までやります。

セットアップ

まずブラウザにTamperMonkey拡張を入れ、このスクリプトもインストールします。次に以下の手順で連携させます。

  1. 拡張 Mouse Dictionary のオプションを開く
  2. 設定を開く
  3. 上級設定を開く
  4. 項目「HTMLテンプレート」をみる
  5. テンプレート「Mouse Dictionaryウィンドウ全体」のdivタグに、クラス名 mouse_dictonary_helper を足す

足した結果はこうなる

<div class="notranslate mouse_dictonary_helper"
     style="all:initial;
            {{systemStyles}}
            width: {{width}}px;
            height: {{height}}px;
            position: fixed;
            overflow-x: hidden;
            overflow-y: {{scroll}};
            top: 5px;
            background-color: {{backgroundColor}};
            z-index: 2147483646;
            padding: 2px 4px 2px 4px;
            border: 1px solid #A0A0A0;"
>
</div>

んで、設定を保存。

  • もし既に Ankiweb に自分の Deck がある場合
    • Deck への単語の二重登録を防ぐため、既存の登録済みの単語をローカルに記録します。この作業はPCごとに必要です。
    • "https://ankiweb.net/search/" を開いて、検索欄に何も入力しないまま Search をクリックします。
    • Card一覧が表示されます。これで既存の登録済みの単語がローカルに記録されました。画面は閉じて大丈夫です。

以上でセットアップ完了です。

実際の動作(手動追加)

  1. Ankiweb にログインする
  2. ページを開いて、Mouse Dictionary 拡張を実行
  3. 単語をダブルクリックで選択固定
  4. Mouse Dictionary ウィンドウをクリック
  5. Ankiweb のデッキ追加ページが開いて、Mouse Dictinary で表示されていた内容がAutofillされる

実際の動作(自動追加&Ankiwebウィンドウ自動クローズ)

  1. Ankiweb にログインする
  2. ページを開いて、Mouse Dictionary 拡張を実行
  3. 単語をダブルクリックで選択固定
  4. Mouse Dictionary ウィンドウを Ctrl + クリック
  5. Ankiweb のデッキ追加ページが開いて、Mouse Dictinary で表示されていた内容がAutofillされる
  6. 自動でAnkiweb のデッキ追加ページのSaveボタンがクリックされる
  7. 自動でAnkiweb のデッキ追加ページがクローズされる

なんでコンテンツがドメインまたいでるの

GM.setValue, GM.getValue で userscript実行環境側のストレージを経由して受け渡しをしています。