-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Localize the add-on and the readme to English (en)
- Loading branch information
1 parent
9295e1c
commit 0cddfa6
Showing
4 changed files
with
278 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"description": { | ||
"message": "Like uc / userChromeJS+Sub-Script Loader, loads user scripts that uses WebExtension APIs via WebDAV server.", | ||
"description": "Description of the extension." | ||
}, | ||
|
||
"popup_oepnOptionsPageButton": { | ||
"message": "Open userChromeES options", | ||
"description": "Menu item to popup when user click the browser’s toolbar icon." | ||
}, | ||
|
||
"options_directorySettingLabel": { | ||
"message": "WebDAV Directory URL", | ||
"description": "Label in the options page." | ||
}, | ||
|
||
"options_directorySettingPlaceholderPort": { | ||
"message": "PORT", | ||
"description": "Part of the placeholder of the text box in the options page. That whole will look like “http://localhost:PORT/PATH/”." | ||
}, | ||
|
||
"options_directorySettingPlaceholderPath": { | ||
"message": "PATH", | ||
"description": "Part of the placeholder of the text box in the options page. That whole will look like “http://localhost:PORT/PATH/”." | ||
}, | ||
|
||
"options_directorySettingPatternDescription": { | ||
"message": "Please enter a URL starting with “http://localhost” and ending with “/”.", | ||
"description": "Description of the pattern of the directory URL setting in the options page. (title attribute value)" | ||
}, | ||
|
||
"options_directorySettingExtensionsDescription": { | ||
"message": "Loads $_UC_JS$ and $_UC_ES$ which is directly under the specified WebDAV directory when this add-on startup.", | ||
"description": "Description of the directory URL setting in the options page. Must not escape special characters in the “message” key value.", | ||
"placeholders": { | ||
"_uc_js": { | ||
"content": "$_UC_JS$", | ||
"example": "<code>*.uc.js</code>" | ||
}, | ||
"_uc_es": { | ||
"content": "$_UC_ES$", | ||
"example": "<code>*.uc.es</code>" | ||
} | ||
} | ||
}, | ||
|
||
"options_directorySettingMethodsDescription": { | ||
"message": "The WebDAV server needs not to allow methods other than $PROPFIND$ or $GET$.", | ||
"description": "Description of the directory URL setting in the options page. Must not escape special characters in the “message” key value.", | ||
"placeholders": { | ||
"propfind": { | ||
"content": "$PROPFIND$", | ||
"example": "<code>PROPFIND</code>" | ||
}, | ||
"get": { | ||
"content": "$GET$", | ||
"example": "<code>GET</code>" | ||
} | ||
} | ||
}, | ||
|
||
"options_loadedScriptsLabel": { | ||
"message": "Loaded Scripts", | ||
"description": "Caption of the script list in the options page." | ||
}, | ||
|
||
"options_scriptsNotLoadedMessage": { | ||
"message": "No scripts were loaded.", | ||
"description": "Message in the script list in the options page." | ||
}, | ||
|
||
"options_metaDataNotExistedValidationMessage": { | ||
"message": "The metadata does not exist.", | ||
"description": "Message in the script list in the options page." | ||
}, | ||
|
||
"options_requiredKeysNotExistedValidationMessage": { | ||
"message": "A valid $KEY$ keys do not exist.", | ||
"description": "Message in the script list in the options page. Must not escape special characters in the “message” key value.", | ||
"placeholders": { | ||
"key": { | ||
"content": "$KEY$", | ||
"example": "<code>@include</code>" | ||
} | ||
} | ||
}, | ||
|
||
"options_alreadyLoadedDescription": { | ||
"message": "The checked scripts will be re-fetched each time pages are visited.", | ||
"description": "Description of the script list in the options page." | ||
}, | ||
|
||
"options_changingMetaDataNotice": { | ||
"message": "Changes you make to $KEY$ are not applied until this add-on are reloaded.", | ||
"description": "Description of the script list in the options page. Must not escape special characters in the “message” key value.", | ||
"placeholders": { | ||
"key": { | ||
"content": "$KEY$", | ||
"example": "<code>@include</code>" | ||
} | ||
} | ||
}, | ||
|
||
"options_backgroundScriptsNotice": { | ||
"message": "Scripts running on $INCLUDE$, regardless of the settings, are loaded when this add-on startup only.", | ||
"description": "Description of the script list in the options page. Must not escape special characters in the “message” key value.", | ||
"placeholders": { | ||
"key": { | ||
"content": "$INCLUDE$", | ||
"example": "<code>background</code>" | ||
} | ||
} | ||
}, | ||
|
||
"options_submitButton": { | ||
"message": "Save and reload", | ||
"description": "Label of the submit button in the options page." | ||
}, | ||
|
||
"sidebar_loadedScriptsCaption": { | ||
"message": "Loaded Files", | ||
"description": "Content of the summary element in the side bar." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
[English](readme.md) / 日本語 | ||
|
||
userChromeES | ||
============ | ||
[uc] / [userChromeJS]+[サブスクリプトローダ] 風に、ローカルに立てた[WebDAV]サーバーを介し、WebExtension APIを叩くユーザースクリプトを読み込むFirefoxアドオンです。 | ||
|
||
**※XPCOM APIにアクセスできるようにするアドオンではないため、userChromeJS用のユーザースクリプトとはまったく互換性がありません。** | ||
|
||
WebExtensionではローカルのファイルを直接読み込めない (Fiefox 57以降) ため、WebDAVサーバー経由で読み込む手段を取っており、**あらかじめローカルにWebDAVサーバーを立てる必要があります。** | ||
|
||
アドオンの設定で指定したWebDAVディレクトリのURLから、拡張子が `*.uc.js`、または `*.uc.es` となっているファイルを、アドオン起動時に読み込みます。サブディレクトリからは読み込みません。 | ||
|
||
[uc]: https://addons.mozilla.org/firefox/addon/uc/ "userChromeJS + Sub-Script/Overlay Loader" | ||
[userChromeJS]: http://userchromejs.mozdev.org/ "JavaScriptを通して、Firefoxのインターフェイスを簡単に改造するための拡張" | ||
[サブスクリプトローダ]: https://github.com/alice0775/userChrome.js/blob/master/userChrome.js "userChrome.jsというファイル名でプロファイルフォルダの中のchromeフォルダに置くことで、同フォルダ内の *.uc.jsファイル(example.uc.jsといったように)や *.uc.xulファイル(または*.xulファイル)を自動で全て読み込むようになります。" | ||
[WebDAV]: https://ja.wikipedia.org/wiki/WebDAV "WebDAVはHypertext Transfer Protocolを拡張したもので、Webサーバ上のファイル管理を目的とした分散ファイルシステムを実現するプロトコルである。" | ||
|
||
インストール | ||
------------ | ||
Addons.mozilla.org (AMO) の[userChromeES :: Firefox 向けアドオン]からインストールできます。 | ||
|
||
[userChromeES :: Firefox 向けアドオン]: https://addons.mozilla.org/ja/firefox/addon/user-chrome-es/ | ||
|
||
メタデータ | ||
---------- | ||
各ユーザースクリプトには[Greasemonkey風のメタデータブロック]が必要です。当アドオンでは以下のキーを解釈します。 | ||
|
||
| メタキー名 | 値の意味 | | | ||
|----------------|--------------------|---| | ||
| `@name` | スクリプト名。 | | | ||
| `@description` | スクリプトの概要。 | | | ||
| `@include` | スクリプトを追加する場所。次のいずれかを指定:<ul><li><code>background</code></li><li><code>popup</code></li><li><code>options</code></li><li><code>devtools</code></li><li><code>sidebar</code></li></ul>複数指定可能。 | **必須** | | ||
|
||
[Greasemonkey風のメタデータブロック]: https://wiki.greasespot.net/Metadata_Block#Syntax | ||
|
||
コード例 | ||
-------- | ||
- [userChromeESを再読み込み](https://greasyfork.org/scripts/34246/code) | ||
|
||
`popup` `options` `sidebar` の拡張 | ||
---------------------------------- | ||
ページごと置き換えるのでなければ、それぞれ以下のようなマークアップ (body要素直下) を想定しています。 | ||
|
||
[/popup/popup.xhtml](popup/popup.xhtml) | ||
--------------------------------------- | ||
- ul | ||
+ li | ||
* :only-child な要素 (a要素やbutton要素) | ||
- img | ||
- テキストや要素 | ||
+ …… | ||
|
||
[/options/options.xhtml](options/options.xhtml) | ||
- article | ||
+ h1 | ||
+ 要素 | ||
+ …… | ||
- …… | ||
|
||
[/sideber/sideber.xhtml](options/options.xhtml) | ||
- menu | ||
+ li | ||
* details | ||
- summary | ||
- menu | ||
+ li | ||
+ …… | ||
+ li | ||
* :only-child な要素 (a要素やbutton要素) | ||
- img | ||
- テキストや要素 | ||
+ …… | ||
|
||
`permissions` / `optional_permissions` | ||
-------------------------------------- | ||
ユーザースクリプトはすべてのWebExtension APIを利用できますが、以下の権限は `optional_permissions` manifest.json キーに含まれています。 | ||
そのため、`/options/options.xhtml` をタブとして開くなどした上で、[permissions API]を利用して権限を要求する必要があります。 | ||
|
||
- `http://localhost/*` 以外のURLに対する host パーミッション | ||
- `bookmarks` | ||
- `clipboardRead` | ||
- `clipboardWrite` | ||
- `cookies` | ||
- `geolocation` | ||
- `history` | ||
- `idle` | ||
- `tabs` | ||
- `topSites` | ||
- `webNavigation` | ||
- `webRequest` | ||
- `webRequestBlocking` | ||
|
||
`activeTab` パーミッションも要求可能です。 | ||
|
||
[permissions API]: https://developer.mozilla.org/Add-ons/WebExtensions/API/permissions | ||
|
||
Contribution | ||
------------ | ||
Pull Request、または Issue よりお願いいたします。 | ||
|
||
ライセンス | ||
---------- | ||
当アドオンのライセンスは [Mozilla Public License Version 2.0] \(MPL-2.0) です。 | ||
|
||
[Mozilla Public License Version 2.0]: https://www.mozilla.org/MPL/2.0/ | ||
|
||
### [/third-party](third-party) | ||
当ディレクトリに含まれるファイルは、Firefoxアドオン[Greasemonkey]の一部であり、[MIT License]で公開されているスクリプトコードです。 | ||
|
||
[Greasemonkey]: https://github.com/greasemonkey/greasemonkey/ | ||
[MIT License]: https://ja.osdn.net/projects/opensource/wiki/licenses/MIT_license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters