Repository navigation
Поддержка Firefox для Android, проверка всех API перед использованием - #7
Merged
Merged
Conversation
- common.js: getApi/hasApi, callApi (fallback when missing), requireApi (clear error for required APIs), addApiListener; all api.* calls use them - Firefox for Android has no windows and commands APIs (@mdn/browser-compat-data); background.js crashed on them before the remaining listeners were registered - popup shown as a page in its own tab (Firefox for Android): the site is the last used other tab (tabs.getCurrent + lastAccessed) - settings fall back to storage.local when storage.sync is missing - tests/android-env.test.js (no browser): Android-like and reduced API environments, helpers; fails on the previous code, passes now - tests: popup opened as a tab in Chromium and Firefox; Chrome incognito test disables HTTPS-First (http-only test server), Firefox private test retries the first call after the addon reload - README and store listings: Firefox for Android (without keyboard shortcuts) Passed locally: unit 4/4, Chromium 141 18/18 (3 runs), Firefox 157.0.1 15/15 (8 runs), Firefox 153.4.0esr 15/15 (2 runs), web-ext lint 0 errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ZZMU6eeKUpne5HfQBAxoT
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Найденная ошибка
По
@mdn/browser-compat-dataв Firefox для Android нет APIwindowsиcommands(firefox_android: false).background.jsвызывалapi.windows.onFocusChanged.addListenerиapi.commands.onCommand.addListenerбез проверки. На Android этоTypeError, и следующие подписки не регистрировались: синхронизация иконки с cookie, изменения настроек, открытие настроек после установки.Что сделано
common.jsдобавлены помощники:getApi/hasApi,callApi(запасное значение, если API нет),requireApi(понятная ошибка для обязательных API — операций с cookie, запроса доступа, сохранения настроек),addApiListener. Все обращения кapi.*во всех файлах идут через них.storage.sync, настройки хранятся вstorage.local.tabs.getCurrent+lastAccessed).Тесты
tests/android-env.test.js(без браузера,npm run test:unit): окружение как у Firefox для Android, урезанные API, помощники. На старом коде 0/4, на новом 4/4.web-ext lint— 0 ошибок.Настоящий Firefox для Android здесь запустить нельзя: нет
/dev/kvmдля эмулятора, Android SDK недоступен.🤖 Generated with Claude Code
https://claude.ai/code/session_011ZZMU6eeKUpne5HfQBAxoT
Generated by Claude Code