Firefox Browser Add-ons
  • Extensions
  • Themes
    • for Firefox
    • Dictionaries & Language Packs
    • Other Browser Sites
    • Add-ons for Android
Log in
Preview of Auto Bookmark History

Auto Bookmark History by Yusuke Takeuchi

automatically bookmark pages that match a set URL

ExperimentalExperimental
0 (0 reviews)0 (0 reviews)
2 Users2 Users
You'll need Firefox to use this extension
Download Firefox and get the extension
Download file

Extension Metadata

About this extension
# ブックマーク設定
設定画面では、自動的にブックマークに追加するルールの設定を行うことができます。各設定項目は以下の通りです。

## 各設定項目

### `title` (必須)

- ブックマークフォルダの名前を設定します。
- 例: `'Youtube'`, `'Wikipedia'`

### `urlPattern` (必須)

- ブックマーク対象とするURLのパターンを設定します。文字列、正規表現、関数のいずれかで設定可能です。
- 文字列の場合: 設定した文字列がURLに含まれていればそのページをブックマークします。
- 正規表現の場合: 設定した正規表現にマッチするURLのページをブックマークします。
- 関数の場合: 設定した関数の戻り値が`true`となるURLのページをブックマークします。
- 例: `'www.youtube.com'`, `(url) => url.indexOf("wikipedia") != -1`

### `normalizer` (任意)

- URLからブックマークの重複判定を行うための正規化関数を設定します。正規表現または関数で設定可能です。重複したブックマークは、前のものが取り除かれます。
- 正規表現の場合: URLから設定した正規表現にマッチする部分文字列を取り出し、それが以前にブックマークしたものと一致しているか判定します。
- 関数の場合: 設定した関数の戻り値が以前にブックマークしたものと一致しているか判定します。
- 例: `(url) => { const md = /v=(\w+)/.exec(url); return md ? md[0] : null; }`, `/(\w+)\.wikipedia\.org\/wiki\/[^\/]+/`

### `maxSize` (任意)

- 各ブックマークフォルダに保存するブックマークの最大数を設定します。数値で設定可能で、デフォルト値は10です。
- 例: `10`, `5`

## 設定ファイルの書き方

設定ファイルはJSON形式で、各ブックマークフォルダの設定を配列で定義します。各設定はJavaScriptのオブジェクトとして記述します。

```json
[
{
"title": "ブックマークフォルダの名前",
"urlPattern": "ブックマーク対象とするURLのパターン",
"normalizer": "ブックマークの重複判定を行うための正規化関数",
"maxSize": "ブックマークの最大数"
},
{
"title": "別のブックマークフォルダの名前",
"urlPattern": "ブックマーク対象とするURLのパターン",
"normalizer": "ブックマークの重複判定を行うための正規化関数",
"maxSize": "ブックマークの最大数"
},
...
]
```

以下に例を示します。
```
[
{
title: 'Youtube',
urlPattern: 'www.youtube.com',
normalizer: (url) => {
const md = /v=(\w+)/.exec(url);
return md ? md[0] : null;
},
maxSize: 10,
},
{
title: "Wikipedia",
urlPattern: (url) => url.indexOf("wikipedia") != -1,
normalizer: /(\w+)\.wikipedia\.org\/wiki\/[^\/]+/,
maxSize: 5,
}
]
```

以上が、自動ブックマークブラウザ拡張の設定ファイルの書き方とその解説になります。
Rated 0 by 0 reviewers
Log in to rate this extension
There are no ratings yet

Star rating saved

5
0
4
0
3
0
2
0
1
0
No reviews yet
Permissions and dataLearn more

Required permissions:

  • Read and modify bookmarks
  • Access browsing history
More information
Add-on Links
  • Support site
Version
0.1.1
Size
1,022.11 kB
Last updated
2 years ago (9 Jul 2023)
Related Categories
  • Bookmarks
Licence
MIT Licence
Version History
  • See all versions
Add to collection
Report this add-on
More extensions by Yusuke Takeuchi
  • There are no ratings yet

  • There are no ratings yet

  • There are no ratings yet

  • There are no ratings yet

  • There are no ratings yet

  • There are no ratings yet

Go to Mozilla's homepage

Add-ons

  • About
  • Firefox Add-ons Blog
  • Extension Workshop
  • Developer Hub
  • Developer Policies
  • Community Blog
  • Forum
  • Report a bug
  • Review Guide

Browsers

  • Desktop
  • Mobile
  • Enterprise

Products

  • Browsers
  • VPN
  • Relay
  • Monitor
  • Pocket
  • Bluesky (@firefox.com)
  • Instagram (Firefox)
  • YouTube (firefoxchannel)
  • Privacy
  • Cookies
  • Legal

Except where otherwise noted, content on this site is licensed under the Creative Commons Attribution Share-Alike Licence v3.0 or any later version.