この翻訳は不完全です。英語から この記事を翻訳 してください。
WebextensionはChromeExtensionやOperaExtensionと互換性があるように設計されています。可能な限り、それぞれのブラウザ向けに書かれた拡張は最低限の変更でFirefoxで実行できるように設計されています。
However, Firefox currently has support for only a limited set of the features and APIs supported by Chrome and Opera. We're working on adding more support, but many features are not yet supported, and we may never support some.
この記事ではFirefoxで完全サポート済みや一部サポート済みの機能やAPIのリストが載っています。一部サポート済みのものに関しては、違いも載っています。
ここに乗っていない機能やAPIはまだサポートしていないと想定してください。
manifest.json features
完全互換性ありkeys
applications
browser_action
page_action
default_locale
description
icons
manifest_version
name
version
web_accessible_resources
一部サポート済みkeys
background
Firefoxは"persistent"プロパティをサポートしていません。バックグラウンドスクリプトは(ページを)ロードした後に残り続けます。
content_scripts
Firefoxは現在サポートしていません:
match_about_blank
permissions
Firefox does not yet support the following permissions:
background
clipboardRead
clipboardWrite
geolocation
nativeMessaging
unlimitedStorage
Obviously, it doesn't yet support permissions for APIs that are themselves not supported.
web_accessible_resources
Firefoxはワイルドカード指定をサポートしていません:個々の web accessible resources を全て指定する必要があります。
JavaScript APIs
完全互換性があるAPI
- alarms
- commands
- contextMenus
- i18n
- pageAction
- Relative URLs passed to
setPopup()
are resolved relative to the caller document, rather than to the extension root
- Relative URLs passed to
一部サポート済み APIs
bookmarks
- Firefox does not support:
import()
export()
onCreated
onRemoved
onChanged
onMoved
onChildrenReordered
onImportBegan
onImportEnded
BookmarkTreeNodeUnmodifiable
- Firefox has special bookmarks like "Recently Bookmarked" or "Recently Visited"
cookies
- onChangedイベントには微妙な違いがあります。
- Creating session cookies with
set
might fail getAllCookieStores
always just returns one default store and no tabs- accessing cookies from private tabs is impossible
- Host permissions are not currently enforced バグ 1210996
extension
- Firefox only supports
:
getBackgroundPage()
getURL()
inIncognitoContext
in content scripts
i18n
- In the JavaScript API, Firefox currently only supports the
getMessage()
method. - Firefox does not yet localize CSS files (バグ 1209184.
notifications
- The only supported notification options are:
iconUrl
title
message
.
- The only supported methods are:
create()
clear()
getAll()
.
- The only supported event is
onClosed
. - Firefox doesn't provide
byUser
data.
runtime
- Firefox only supports:
onStartup()
getManifest()
getURL()
id
sendMessage()
onMessage
onConnect
storage
- The only storage area Firefox supports is
local
. - Firefox does not support
getBytesInUse()
. - The storage API is not supported in content scripts.
tabs
- Firefox does not support:
sendRequest()
getSelected()
duplicate()
highlight()
move()
detectLanguage()
captureVisibleTab()
getZoom()
setZoom()
getZoomSettings()
setZoomSettings()
- The
callback
argument toexecuteScript()
orinsertCSS
バグ 1210583.
- Additionally, Firefox currently:
- Treats
highlighted
andactive
as the same, since Firefox has no concept of selecting multiple tabs. - Does not enforce host permissions for
executeScript()
バグ 1193837.
- Treats
webNavigation
- Firefox does not support:
getFrame()
getAllFrames()
onCreatedNavigationTarget
onHistoryStateUpdated
- transition types and qualifiers
- Filtering
onReferenceFragmentUpdated
also triggers for pushState
.
webRequest
- Firefox does not support:
handlerBehaviorChanged()
onAuthRequired
onBeforeRedirect
onErrorOccurred
- Requests can be:
- canceled only in
onBeforeRequest
- modified/redirected only in
onBeforeSendHeaders
- canceled only in
- Responses can be modified only in
onHeadersReceived
. - Filtering by
windowId
andtabId
is not supported. - The
"requestBody"
instruction inopt_extraInfoSpec
is not supported. - Redirection is not allowed in
onBeforeRequest
oronHeadersReceived
, but is allowed inonBeforeSendHeaders
. requestId
is not included in the argument passed to the listener.
windows
onFocusChanged
will trigger multiple times for a given focus change.create()
does not support thefocused
,type
, orstate
options.update()
only supports thefocused
option.
サポート予定APIs
私たちはまだこれらのAPIをサポートしていませんが、サポートする予定はあります。最新版は英語のページを見てください。
- commands
- Devtools (mostly panels)
- downloads
- history
- idle
- omnibox
- permissions
- Native messaging (runtime.connectNative)
CSS
Localized String Interpolation
We currently do not support interpolation of localized strings __MSG_
tokens in extension CSS files: バグ 1209184.
Relative URLs
We resolve URLs in injected CSS files relative to the CSS file itself, rather than to the page it's injected into.
その他の非互換性
- Chrome allows any optional arguments to be omitted, even if followed by other arguments. Firefox currently supports this only under specific circumstances. We recommend only omitting optional arguments at the end of the arguments list, and using
null
for all other cases.